Commit 9f3b4475 authored by keyongyu's avatar keyongyu

2.2.9.4

parent 6fe93422
...@@ -257,6 +257,10 @@ private void InitializeComponent() ...@@ -257,6 +257,10 @@ private void InitializeComponent()
this.documentMap1.Text = "documentMap1"; this.documentMap1.Text = "documentMap1";
this.documentMap1.Visible = false; this.documentMap1.Visible = false;
// //
// backgroundWorker1
//
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
//
// CodeEditForm // CodeEditForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using DataEditorX.Core; using DataEditorX.Core;
using DataEditorX.Config; using DataEditorX.Config;
using System.Configuration;
using DataEditorX.Controls; using DataEditorX.Controls;
namespace DataEditorX namespace DataEditorX
......
using System; 
using System.Collections.Generic;
using System.Text;
namespace DataEditorX.Common namespace DataEditorX.Common
{ {
/// <summary>
/// 区域
/// </summary>
public class Area public class Area
{ {
public Area() public Area()
...@@ -13,10 +13,21 @@ public Area() ...@@ -13,10 +13,21 @@ public Area()
width = 0; width = 0;
height = 0; height = 0;
} }
/// <summary>
/// 左
/// </summary>
public int left; public int left;
/// <summary>
/// 顶
/// </summary>
public int top; public int top;
/// <summary>
/// 宽
/// </summary>
public int width; public int width;
/// <summary>
/// 高
/// </summary>
public int height; public int height;
} }
} }
...@@ -5,30 +5,40 @@ ...@@ -5,30 +5,40 @@
* 时间: 9:58 * 时间: 9:58
* *
*/ */
using System;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Text; using System.Text;
using System.Windows.Forms;
namespace DataEditorX namespace DataEditorX.Common
{ {
/// <summary> /// <summary>
/// Description of CheckUpdate. /// 检查更新
/// </summary> /// </summary>
public static class CheckUpdate public static class CheckUpdate
{ {
static CheckUpdate() static CheckUpdate()
{ {
//连接数
ServicePointManager.DefaultConnectionLimit = 255; ServicePointManager.DefaultConnectionLimit = 255;
} }
/// <summary>
/// 下载URL
/// </summary>
public static string URL = ""; public static string URL = "";
static string HEAD = "[DataEditorX]", HEAD2 = "[URL]"; /// <summary>
public static bool isOK = false; /// 从HEAD获取版本号
/// </summary>
const string HEAD = "[DataEditorX]";
const string HEAD2 = "[URL]";
public const string DEFALUT = "0.0.0.0"; public const string DEFALUT = "0.0.0.0";
public const int VER_LENGTH = 4; const int VER_LENGTH = 4;
#region 检查版本 #region 检查版本
/// <summary>
/// 获取新版本
/// </summary>
/// <param name="VERURL">链接</param>
/// <returns>版本号</returns>
public static string GetNewVersion(string VERURL) public static string GetNewVersion(string VERURL)
{ {
string urlver = DEFALUT; string urlver = DEFALUT;
...@@ -53,7 +63,12 @@ public static string GetNewVersion(string VERURL) ...@@ -53,7 +63,12 @@ public static string GetNewVersion(string VERURL)
} }
return urlver; return urlver;
} }
//检查版本号,格式0.0.0.0 /// <summary>
/// 检查版本号,格式0.0.0.0
/// </summary>
/// <param name="ver">0.0.0.0</param>
/// <param name="oldver">0.0.0.0</param>
/// <returns>是否有新版本</returns>
public static bool CheckVersion(string ver, string oldver) public static bool CheckVersion(string ver, string oldver)
{ {
bool hasNew = false; bool hasNew = false;
...@@ -61,12 +76,12 @@ public static bool CheckVersion(string ver, string oldver) ...@@ -61,12 +76,12 @@ public static bool CheckVersion(string ver, string oldver)
string[] oldvers = oldver.Split('.'); string[] oldvers = oldver.Split('.');
if (vers.Length == oldvers.Length && vers.Length == VER_LENGTH) if (vers.Length == oldvers.Length && vers.Length == VER_LENGTH)
{ {
int j, k; int j, k;//从左到右比较数字
for (int i = 0; i < VER_LENGTH; i++) for (int i = 0; i < VER_LENGTH; i++)
{ {
int.TryParse(vers[i], out j); int.TryParse(vers[i], out j);
int.TryParse(oldvers[i], out k); int.TryParse(oldvers[i], out k);
if (j > k) if (j > k)//新的版本号大于旧的
{ {
hasNew = true; hasNew = true;
break; break;
...@@ -82,6 +97,11 @@ public static bool CheckVersion(string ver, string oldver) ...@@ -82,6 +97,11 @@ public static bool CheckVersion(string ver, string oldver)
#endregion #endregion
#region 获取网址内容 #region 获取网址内容
/// <summary>
/// 获取网址内容
/// </summary>
/// <param name="url">网址</param>
/// <returns>内容</returns>
public static string GetHtmlContentByUrl(string url) public static string GetHtmlContentByUrl(string url)
{ {
string htmlContent = string.Empty; string htmlContent = string.Empty;
...@@ -116,6 +136,11 @@ public static string GetHtmlContentByUrl(string url) ...@@ -116,6 +136,11 @@ public static string GetHtmlContentByUrl(string url)
#endregion #endregion
#region 下载文件 #region 下载文件
/// <summary>
/// 下载文件
/// </summary>
/// <param name="filename">保存文件路径</param>
/// <returns>是否下载成功</returns>
public static bool DownLoad(string filename) public static bool DownLoad(string filename)
{ {
try try
...@@ -142,10 +167,9 @@ public static bool DownLoad(string filename) ...@@ -142,10 +167,9 @@ public static bool DownLoad(string filename)
} }
catch (System.Exception) catch (System.Exception)
{ {
isOK = false; return false;
} }
isOK = true; return true;
return isOK;
} }
#endregion #endregion
} }
......
...@@ -2,17 +2,15 @@ ...@@ -2,17 +2,15 @@
* date :2014-02-07 * date :2014-02-07
* desc :图像处理,裁剪,缩放,保存 * desc :图像处理,裁剪,缩放,保存
*/ */
using System;
using System.IO; using System.IO;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using DataEditorX.Common;
namespace DataEditorX.Common namespace DataEditorX.Common
{ {
/// <summary> /// <summary>
/// Description of ImageHelper. /// 图片裁剪,缩放,保存高质量jpg
/// </summary> /// </summary>
public static class MyBitmap public static class MyBitmap
{ {
...@@ -30,9 +28,13 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight) ...@@ -30,9 +28,13 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight)
{ {
Bitmap b = new Bitmap(newWidth, newHeight); Bitmap b = new Bitmap(newWidth, newHeight);
Graphics graphics = Graphics.FromImage(b); Graphics graphics = Graphics.FromImage(b);
//合成:高质量,低速度
graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.CompositingQuality = CompositingQuality.HighQuality;
//去除锯齿
graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.SmoothingMode = SmoothingMode.HighQuality;
//偏移:高质量,低速度
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
//插补算法
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle newRect = new Rectangle(0, 0, newWidth, newHeight); Rectangle newRect = new Rectangle(0, 0, newWidth, newHeight);
Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height); Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height);
...@@ -45,6 +47,12 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight) ...@@ -45,6 +47,12 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight)
#endregion #endregion
#region 裁剪 #region 裁剪
/// <summary>
/// 裁剪图片
/// </summary>
/// <param name="sourceBitmap">图片源</param>
/// <param name="area">区域</param>
/// <returns></returns>
public static Bitmap Cut(Bitmap sourceBitmap, Area area) public static Bitmap Cut(Bitmap sourceBitmap, Area area)
{ {
return Cut(sourceBitmap, area.left, area.top, area.width, area.height); return Cut(sourceBitmap, area.left, area.top, area.width, area.height);
...@@ -64,16 +72,26 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid ...@@ -64,16 +72,26 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid
{ {
int w = sourceBitmap.Width; int w = sourceBitmap.Width;
int h = sourceBitmap.Height; int h = sourceBitmap.Height;
//裁剪的区域宽度调整
if ( ( StartX + cutWidth ) > w ) if ( ( StartX + cutWidth ) > w )
{ {
cutWidth = w - StartX; cutWidth = w - StartX;
} }
//裁剪的区域高度调整
if ( ( StartY + cutHeight ) > h ) if ( ( StartY + cutHeight ) > h )
{ {
cutHeight = h - StartY; cutHeight = h - StartY;
} }
Bitmap bitmap = new Bitmap(cutWidth, cutHeight); Bitmap bitmap = new Bitmap(cutWidth, cutHeight);
Graphics graphics = Graphics.FromImage(bitmap); Graphics graphics = Graphics.FromImage(bitmap);
//合成:高质量,低速度
graphics.CompositingQuality = CompositingQuality.HighQuality;
//去除锯齿
graphics.SmoothingMode = SmoothingMode.HighQuality;
//偏移:高质量,低速度
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
//插补算法
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle cutRect = new Rectangle(0, 0, cutWidth, cutHeight); Rectangle cutRect = new Rectangle(0, 0, cutWidth, cutHeight);
Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight); Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight);
graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel); graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel);
...@@ -97,9 +115,9 @@ public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality) ...@@ -97,9 +115,9 @@ public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality)
if ( bitmap != null ) if ( bitmap != null )
{ {
string path=Path.GetDirectoryName(filename); string path=Path.GetDirectoryName(filename);
if(!Directory.Exists(path)) if(!Directory.Exists(path))//创建文件夹
Directory.CreateDirectory(path); Directory.CreateDirectory(path);
if(File.Exists(filename)) if(File.Exists(filename))//删除旧文件
File.Delete(filename); File.Delete(filename);
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null; ImageCodecInfo ici = null;
......
...@@ -12,11 +12,16 @@ ...@@ -12,11 +12,16 @@
namespace System.IO namespace System.IO
{ {
/// <summary> /// <summary>
/// Description of MyPath. /// 路径处理
/// </summary> /// </summary>
public class MyPath public class MyPath
{ {
public static string GetFullPath(string dir) /// <summary>
/// 从相对路径获取真实路径
/// </summary>
/// <param name="dir"></param>
/// <returns></returns>
public static string GetRealPath(string dir)
{ {
string path = Application.StartupPath; string path = Application.StartupPath;
if (dir.StartsWith(".")) if (dir.StartsWith("."))
...@@ -25,7 +30,12 @@ public static string GetFullPath(string dir) ...@@ -25,7 +30,12 @@ public static string GetFullPath(string dir)
} }
return dir; return dir;
} }
public static string Combine(params string[] paths) /// <summary>
/// 合并路径
/// </summary>
/// <param name="paths"></param>
/// <returns></returns>
public static string Combine(params string[] paths)
{ {
if (paths.Length == 0) if (paths.Length == 0)
{ {
...@@ -68,24 +78,52 @@ public static string Combine(params string[] paths) ...@@ -68,24 +78,52 @@ public static string Combine(params string[] paths)
return builder.ToString(); return builder.ToString();
} }
} }
//检查目录是否合法 /// <summary>
/// 检查目录是否合法
/// </summary>
/// <param name="dir">目录</param>
/// <param name="defalut">不合法时,采取的目录</param>
/// <returns></returns>
public static string CheckDir(string dir,string defalut) public static string CheckDir(string dir,string defalut)
{ {
DirectoryInfo fo; DirectoryInfo fo;
try try
{ {
fo = new DirectoryInfo(MyPath.GetFullPath(dir)); fo = new DirectoryInfo(MyPath.GetRealPath(dir));
} }
catch catch{
{
//路径不合法 //路径不合法
fo = new DirectoryInfo(defalut); fo = new DirectoryInfo(defalut);
} }
if (!fo.Exists) if (!fo.Exists)
fo.Create(); fo.Create();
dir = fo.FullName; dir = fo.FullName;
return dir; return dir;
} }
} /// <summary>
/// 根据tag获取文件名
/// tag_lang.txt
/// </summary>
/// <param name="tag">前面</param>
/// <param name="lang"></param>
/// <returns></returns>
public static string getFileName(string tag,string lang)
{
return tag+"_" + lang + ".txt";
}
/// <summary>
/// 由tag和lang获取文件名
/// </summary>
/// <param name="tag"></param>
/// <param name="file"></param>
/// <returns></returns>
public static string getFullFileName(string tag, string file)
{
string name = Path.GetFileNameWithoutExtension(file);
if (!name.StartsWith(tag + "_"))
return "";
else
return name.Replace(tag + "_", "");
}
}
} }
...@@ -15,8 +15,27 @@ namespace System ...@@ -15,8 +15,27 @@ namespace System
/// </summary> /// </summary>
public class User32 public class User32
{ {
/// <summary>
/// 发送窗口消息
/// </summary>
/// <param name="hWnd"></param>
/// <param name="msg"></param>
/// <param name="wParam"></param>
/// <param name="lParam"></param>
/// <returns></returns>
[DllImport("User32.dll", EntryPoint = "SendMessage")] [DllImport("User32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hWnd, int msg, uint wParam, uint lParam); public static extern int SendMessage(IntPtr hWnd, int msg, uint wParam, uint lParam);
/// <summary>
/// 设置窗口的位置
/// </summary>
/// <param name="hWnd"></param>
/// <param name="hWndInsertAfter"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="Width"></param>
/// <param name="Height"></param>
/// <param name="flags"></param>
/// <returns></returns>
[DllImport("user32.dll", CharSet = CharSet.Auto)] [DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags); public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags);
/// <summary> /// <summary>
...@@ -25,10 +44,5 @@ public class User32 ...@@ -25,10 +44,5 @@ public class User32
/// <returns></returns> /// <returns></returns>
[DllImport("user32.dll", CharSet = CharSet.Auto)] [DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern System.IntPtr GetForegroundWindow(); public static extern System.IntPtr GetForegroundWindow();
public static void WindowToTop()
{
}
} }
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ public enum Compression : ushort { ...@@ -21,6 +21,7 @@ public enum Compression : ushort {
/// <summary>Deflate compression method</summary> /// <summary>Deflate compression method</summary>
Deflate = 8 } Deflate = 8 }
#region ZipFileEntry
/// <summary> /// <summary>
/// Represents an entry in Zip file directory /// Represents an entry in Zip file directory
/// </summary> /// </summary>
...@@ -56,6 +57,7 @@ public override string ToString() ...@@ -56,6 +57,7 @@ public override string ToString()
return this.FilenameInZip; return this.FilenameInZip;
} }
} }
#endregion
#region Public fields #region Public fields
/// <summary>True if UTF8 encoding for filename and comments, false if default (CP 437)</summary> /// <summary>True if UTF8 encoding for filename and comments, false if default (CP 437)</summary>
......
...@@ -27,19 +27,28 @@ public void Init() ...@@ -27,19 +27,28 @@ public void Init()
//函数提示 //函数提示
Dictionary<string, string> tooltipDic; Dictionary<string, string> tooltipDic;
//自动完成 //函数列表
List<AutocompleteItem> funList; List<AutocompleteItem> funList;
//常量列表
List<AutocompleteItem> conList; List<AutocompleteItem> conList;
/// <summary>
/// 输入提示
/// </summary>
public Dictionary<string, string> TooltipDic public Dictionary<string, string> TooltipDic
{ {
get { return tooltipDic; } get { return tooltipDic; }
} }
/// <summary>
/// 函数列表
/// </summary>
public AutocompleteItem[] FunList public AutocompleteItem[] FunList
{ {
get { return funList.ToArray(); } get { return funList.ToArray(); }
} }
/// <summary>
/// 常量列表
/// </summary>
public AutocompleteItem[] ConList public AutocompleteItem[] ConList
{ {
get { return conList.ToArray(); } get { return conList.ToArray(); }
...@@ -47,8 +56,11 @@ public AutocompleteItem[] ConList ...@@ -47,8 +56,11 @@ public AutocompleteItem[] ConList
#endregion #endregion
#region 系列名/指示物 #region 系列名/指示物
//系列名 /// <summary>
public void SetNames(Dictionary<long, string> dic) /// 设置系列名
/// </summary>
/// <param name="dic"></param>
public void SetNames(SortedList<long, string> dic)
{ {
foreach (long k in dic.Keys) foreach (long k in dic.Keys)
{ {
...@@ -59,7 +71,10 @@ public void SetNames(Dictionary<long, string> dic) ...@@ -59,7 +71,10 @@ public void SetNames(Dictionary<long, string> dic)
} }
} }
} }
//指示物 /// <summary>
/// 读取指示物
/// </summary>
/// <param name="file"></param>
public void AddStrings(string file) public void AddStrings(string file)
{ {
if (File.Exists(file)) if (File.Exists(file))
...@@ -67,6 +82,7 @@ public void AddStrings(string file) ...@@ -67,6 +82,7 @@ public void AddStrings(string file)
string[] lines = File.ReadAllLines(file); string[] lines = File.ReadAllLines(file);
foreach (string line in lines) foreach (string line in lines)
{ {
//特殊胜利和指示物
if (line.StartsWith("!victory") if (line.StartsWith("!victory")
|| line.StartsWith("!counter")) || line.StartsWith("!counter"))
{ {
...@@ -83,7 +99,10 @@ public void AddStrings(string file) ...@@ -83,7 +99,10 @@ public void AddStrings(string file)
#endregion #endregion
#region function #region function
//函数 /// <summary>
/// 添加函数
/// </summary>
/// <param name="funtxt"></param>
public void AddFunction(string funtxt) public void AddFunction(string funtxt)
{ {
if (!File.Exists(funtxt)) if (!File.Exists(funtxt))
...@@ -108,6 +127,7 @@ public void AddFunction(string funtxt) ...@@ -108,6 +127,7 @@ public void AddFunction(string funtxt)
if (t < w && t > 0) if (t < w && t > 0)
{ {
//找到函数
name = line.Substring(t + 1, w - t - 1); name = line.Substring(t + 1, w - t - 1);
isFind = true; isFind = true;
desc = line; desc = line;
...@@ -173,6 +193,7 @@ public void AddConstant(string conlua) ...@@ -173,6 +193,7 @@ public void AddConstant(string conlua)
string k = line, desc = line; string k = line, desc = line;
int t = line.IndexOf("="); int t = line.IndexOf("=");
int t2 = line.IndexOf("--"); int t2 = line.IndexOf("--");
//常量 = 0x1 ---注释
k = (t > 0) ? line.Substring(0, t).TrimEnd(new char[] { ' ', '\t' }) k = (t > 0) ? line.Substring(0, t).TrimEnd(new char[] { ' ', '\t' })
: line; : line;
desc = (t > 0) ? line.Substring(t + 1).Replace("--", "\n") desc = (t > 0) ? line.Substring(t + 1).Replace("--", "\n")
......
...@@ -7,7 +7,15 @@ namespace DataEditorX.Config ...@@ -7,7 +7,15 @@ namespace DataEditorX.Config
{ {
public class ConfHelper public class ConfHelper
{ {
/// <summary>
/// 内容分隔符
/// </summary>
public const string SEP_LINE = " "; public const string SEP_LINE = " ";
/// <summary>
/// 从行获取值
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public static string getValue(string line) public static string getValue(string line)
{ {
int t = line.IndexOf('='); int t = line.IndexOf('=');
...@@ -15,6 +23,11 @@ public static string getValue(string line) ...@@ -15,6 +23,11 @@ public static string getValue(string line)
return line.Substring(t + 1).Trim(); return line.Substring(t + 1).Trim();
return ""; return "";
} }
/// <summary>
/// 从词中获取第一个值
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public static string getValue1(string word) public static string getValue1(string word)
{ {
int i = word.IndexOf(SEP_LINE); int i = word.IndexOf(SEP_LINE);
...@@ -22,6 +35,11 @@ public static string getValue1(string word) ...@@ -22,6 +35,11 @@ public static string getValue1(string word)
return word.Substring(0, i); return word.Substring(0, i);
return ""; return "";
} }
/// <summary>
/// 从词中获取第二个值
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public static string getValue2(string word) public static string getValue2(string word)
{ {
int i = word.IndexOf(SEP_LINE); int i = word.IndexOf(SEP_LINE);
...@@ -29,10 +47,20 @@ public static string getValue2(string word) ...@@ -29,10 +47,20 @@ public static string getValue2(string word)
return word.Substring(i + SEP_LINE.Length); return word.Substring(i + SEP_LINE.Length);
return ""; return "";
} }
/// <summary>
/// 获取多行值,替换\n \t
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public static string getMultLineValue(string line) public static string getMultLineValue(string line)
{ {
return getRegex(getValue(line)); return getRegex(getValue(line));
} }
/// <summary>
/// 替换特殊符
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public static string getRegex(string word) public static string getRegex(string word)
{ {
StringBuilder sb = new StringBuilder(word); StringBuilder sb = new StringBuilder(word);
...@@ -42,6 +70,11 @@ public static string getRegex(string word) ...@@ -42,6 +70,11 @@ public static string getRegex(string word)
sb.Replace("[:space:]", " "); sb.Replace("[:space:]", " ");
return sb.ToString(); return sb.ToString();
} }
/// <summary>
/// 获取boolean值
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public static bool getBooleanValue(string line) public static bool getBooleanValue(string line)
{ {
if (getValue(line).ToLower() == "true") if (getValue(line).ToLower() == "true")
...@@ -49,7 +82,12 @@ public static bool getBooleanValue(string line) ...@@ -49,7 +82,12 @@ public static bool getBooleanValue(string line)
else else
return false; return false;
} }
/// <summary>
/// 获取int值
/// </summary>
/// <param name="line"></param>
/// <param name="defalut">失败的值</param>
/// <returns></returns>
public static int getIntegerValue(string line, int defalut) public static int getIntegerValue(string line, int defalut)
{ {
int i; int i;
...@@ -61,6 +99,12 @@ public static int getIntegerValue(string line, int defalut) ...@@ -61,6 +99,12 @@ public static int getIntegerValue(string line, int defalut)
catch{} catch{}
return defalut; return defalut;
} }
/// <summary>
/// 从行获取内容添加到字典
/// race 0x1 xxx
/// </summary>
/// <param name="dic"></param>
/// <param name="line"></param>
public static void DicAdd(Dictionary<long, string> dic, string line) public static void DicAdd(Dictionary<long, string> dic, string line)
{ {
int i = line.IndexOf("0x"); int i = line.IndexOf("0x");
......
...@@ -24,18 +24,22 @@ public DataConfig(string conf) ...@@ -24,18 +24,22 @@ public DataConfig(string conf)
{ {
InitMember(conf); InitMember(conf);
} }
/// <summary>
/// 初始化成员
/// </summary>
/// <param name="conf"></param>
public void InitMember(string conf) public void InitMember(string conf)
{ {
//conf = MyPath.Combine(datapath, MyConfig.FILE_INFO); //conf = MyPath.Combine(datapath, MyConfig.FILE_INFO);
if(!File.Exists(conf)) if(!File.Exists(conf))
{ {
dicCardRules = new Dictionary<long, string>(); dicCardRules = new SortedList<long, string>();
dicSetnames =new Dictionary<long, string>(); dicSetnames = new SortedList<long, string>();
dicCardTypes =new Dictionary<long, string>(); dicCardTypes = new SortedList<long, string>();
dicCardcategorys =new Dictionary<long, string>(); dicCardcategorys = new SortedList<long, string>();
dicCardAttributes =new Dictionary<long, string>(); dicCardAttributes = new SortedList<long, string>();
dicCardRaces =new Dictionary<long, string>(); dicCardRaces = new SortedList<long, string>();
dicCardLevels =new Dictionary<long, string>(); dicCardLevels = new SortedList<long, string>();
return; return;
} }
//提取内容 //提取内容
...@@ -49,13 +53,33 @@ public void InitMember(string conf) ...@@ -49,13 +53,33 @@ public void InitMember(string conf)
dicCardLevels = DataManager.Read(text, MyConfig.TAG_LEVEL); dicCardLevels = DataManager.Read(text, MyConfig.TAG_LEVEL);
} }
/// <summary>
public Dictionary<long, string> dicCardRules = null; /// 规则
public Dictionary<long, string> dicCardAttributes = null; /// </summary>
public Dictionary<long, string> dicCardRaces = null; public SortedList<long, string> dicCardRules = null;
public Dictionary<long, string> dicCardLevels = null; /// <summary>
public Dictionary<long, string> dicSetnames = null; /// 属性
public Dictionary<long, string> dicCardTypes = null; /// </summary>
public Dictionary<long, string> dicCardcategorys = null; public SortedList<long, string> dicCardAttributes = null;
/// <summary>
/// 种族
/// </summary>
public SortedList<long, string> dicCardRaces = null;
/// <summary>
/// 等级
/// </summary>
public SortedList<long, string> dicCardLevels = null;
/// <summary>
/// 系列名
/// </summary>
public SortedList<long, string> dicSetnames = null;
/// <summary>
/// 卡片类型
/// </summary>
public SortedList<long, string> dicCardTypes = null;
/// <summary>
/// 效果类型
/// </summary>
public SortedList<long, string> dicCardcategorys = null;
} }
} }
...@@ -16,8 +16,17 @@ namespace DataEditorX.Config ...@@ -16,8 +16,17 @@ namespace DataEditorX.Config
{ {
public class DataManager public class DataManager
{ {
/// <summary>
/// 内容开头
/// </summary>
public const string TAG_START = "##"; public const string TAG_START = "##";
/// <summary>
/// 内容结尾
/// </summary>
public const string TAG_END = "#"; public const string TAG_END = "#";
/// <summary>
/// 行分隔符
/// </summary>
public const char SEP_LINE = '\t'; public const char SEP_LINE = '\t';
#region 根据tag获取内容 #region 根据tag获取内容
...@@ -46,7 +55,7 @@ public static string subString(string content, string tag) ...@@ -46,7 +55,7 @@ public static string subString(string content, string tag)
/// <param name="content">字符串</param> /// <param name="content">字符串</param>
/// <param name="tag">开始的标志</param> /// <param name="tag">开始的标志</param>
/// <returns></returns> /// <returns></returns>
public static Dictionary<long, string> Read(string content, string tag) public static SortedList<long, string> Read(string content, string tag)
{ {
return Read(subString(content,tag)); return Read(subString(content,tag));
} }
...@@ -56,7 +65,7 @@ public static string subString(string content, string tag) ...@@ -56,7 +65,7 @@ public static string subString(string content, string tag)
/// <param name="strFile"></param> /// <param name="strFile"></param>
/// <param name="encode"></param> /// <param name="encode"></param>
/// <returns></returns> /// <returns></returns>
public static Dictionary<long, string> Read(string strFile, Encoding encode) public static SortedList<long, string> Read(string strFile, Encoding encode)
{ {
return Read(File.ReadAllLines(strFile, encode)); return Read(File.ReadAllLines(strFile, encode));
} }
...@@ -65,7 +74,7 @@ public static string subString(string content, string tag) ...@@ -65,7 +74,7 @@ public static string subString(string content, string tag)
/// </summary> /// </summary>
/// <param name="content"></param> /// <param name="content"></param>
/// <returns></returns> /// <returns></returns>
public static Dictionary<long, string> Read(string content) public static SortedList<long, string> Read(string content)
{ {
string text = reReturn(content); string text = reReturn(content);
return Read(text.Split('\n')); return Read(text.Split('\n'));
...@@ -75,9 +84,9 @@ public static string subString(string content, string tag) ...@@ -75,9 +84,9 @@ public static string subString(string content, string tag)
/// </summary> /// </summary>
/// <param name="lines"></param> /// <param name="lines"></param>
/// <returns></returns> /// <returns></returns>
public static Dictionary<long, string> Read(string[] lines) public static SortedList<long, string> Read(string[] lines)
{ {
Dictionary<long, string> tempDic = new Dictionary<long, string>(); SortedList<long, string> tempDic = new SortedList<long, string>();
long lkey; long lkey;
foreach (string line in lines) foreach (string line in lines)
{ {
...@@ -100,47 +109,35 @@ public static string subString(string content, string tag) ...@@ -100,47 +109,35 @@ public static string subString(string content, string tag)
#endregion #endregion
#region 查找 #region 查找
/// <summary> public static List<long> GetKeys(SortedList<long, string> dic)
/// {
/// </summary> List<long> list = new List<long>();
/// <param name="dic"></param> foreach (long l in dic.Keys)
/// <param name="strValue"></param>
/// <param name="defaultKey"></param>
/// <returns></returns>
public static long GetKey(
Dictionary<long, string> dic,
string strValue,
long defaultKey
){
long lkey=defaultKey;
if(!dic.ContainsValue(strValue))
return lkey;
foreach(long key in dic.Keys)
{ {
if(dic[key]==strValue) list.Add(l);
{
lkey=key;
break;
}
} }
return lkey; return list;
} }
#endregion public static string[] GetValues(SortedList<long, string> dic)
#region value
public static string[] GetValues(Dictionary<long, string> dic)
{ {
int length=dic.Count; string[] strs = new string[dic.Count];
string[] words=new string[1]; int j = strs.Length;
words[0]="N/A"; if (j == 0)
if(length > 0) return strs;
for (int i = 0; i < j; i++)
{ {
words=new string[length]; strs[i] = dic.Values[i];
dic.Values.CopyTo(words,0);
} }
return words; return strs;
} }
public static string GetValue(Dictionary<long, string> dic,long key){ /// <summary>
/// 获取值
/// </summary>
/// <param name="dic"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetValue(SortedList<long, string> dic, long key)
{
if(dic.ContainsKey(key)) if(dic.ContainsKey(key))
return dic[key].Trim(); return dic[key].Trim();
return key.ToString("x"); return key.ToString("x");
......
...@@ -12,19 +12,17 @@ ...@@ -12,19 +12,17 @@
namespace DataEditorX.Config namespace DataEditorX.Config
{ {
/// <summary>
/// 裁剪图片是、配置
/// </summary>
public class ImageSet public class ImageSet
{ {
bool isInit;
public ImageSet(){ public ImageSet(){
isInit=false; Init();
} }
public void Init() //初始化
void Init()
{ {
if(isInit)
return;
isInit=true;
this.normalArea = MyConfig.readArea(MyConfig.TAG_IMAGE_OTHER); this.normalArea = MyConfig.readArea(MyConfig.TAG_IMAGE_OTHER);
this.xyzArea = MyConfig.readArea(MyConfig.TAG_IMAGE_XYZ); this.xyzArea = MyConfig.readArea(MyConfig.TAG_IMAGE_XYZ);
...@@ -40,10 +38,37 @@ public void Init() ...@@ -40,10 +38,37 @@ public void Init()
this.quilty = MyConfig.readInteger(MyConfig.TAG_IMAGE_QUILTY, 95); this.quilty = MyConfig.readInteger(MyConfig.TAG_IMAGE_QUILTY, 95);
} }
/// <summary>
/// jpeg质量
/// </summary>
public int quilty; public int quilty;
public int w,h,W,H; /// <summary>
/// 小图的宽
/// </summary>
public int w;
/// <summary>
/// 小图的高
/// </summary>
public int h;
/// <summary>
/// 大图的宽
/// </summary>
public int W;
/// <summary>
/// 大图的高
/// </summary>
public int H;
/// <summary>
/// 怪兽的中间图
/// </summary>
public Area normalArea; public Area normalArea;
/// <summary>
/// xyz怪兽的中间图
/// </summary>
public Area xyzArea; public Area xyzArea;
/// <summary>
/// p怪的中间图
/// </summary>
public Area pendulumArea; public Area pendulumArea;
} }
} }
...@@ -20,7 +20,9 @@ namespace DataEditorX.Config ...@@ -20,7 +20,9 @@ namespace DataEditorX.Config
/// </summary> /// </summary>
public class MSEConfig public class MSEConfig
{ {
public const string TAG = "mse";
public const string TAG_HEAD = "head"; public const string TAG_HEAD = "head";
public const string TAG_END = "end";
public const string TAG_CN2TW = "cn2tw"; public const string TAG_CN2TW = "cn2tw";
public const string TAG_SPELL = "spell"; public const string TAG_SPELL = "spell";
public const string TAG_TRAP = "trap"; public const string TAG_TRAP = "trap";
...@@ -52,7 +54,7 @@ public void SetConfig(string config, string path) ...@@ -52,7 +54,7 @@ public void SetConfig(string config, string path)
regx_monster = "(\\s\\S*?)"; regx_monster = "(\\s\\S*?)";
regx_pendulum = "(\\s\\S*?)"; regx_pendulum = "(\\s\\S*?)";
//设置文件名 //设置文件名
configName = getLanguage(config); configName = MyPath.getFullFileName(MSEConfig.TAG, config);
replaces = new Dictionary<string, string>(); replaces = new Dictionary<string, string>();
...@@ -69,6 +71,8 @@ public void SetConfig(string config, string path) ...@@ -69,6 +71,8 @@ public void SetConfig(string config, string path)
str_spell = ConfHelper.getValue(line); str_spell = ConfHelper.getValue(line);
else if (line.StartsWith(TAG_HEAD)) else if (line.StartsWith(TAG_HEAD))
head = ConfHelper.getMultLineValue(line); head = ConfHelper.getMultLineValue(line);
else if (line.StartsWith(TAG_END))
end = ConfHelper.getMultLineValue(line);
else if (line.StartsWith(TAG_TEXT)) else if (line.StartsWith(TAG_TEXT))
temp_text = ConfHelper.getMultLineValue(line); temp_text = ConfHelper.getMultLineValue(line);
else if (line.StartsWith(TAG_TRAP)) else if (line.StartsWith(TAG_TRAP))
...@@ -108,28 +112,17 @@ public void init(string path) ...@@ -108,28 +112,17 @@ public void init(string path)
Iscn2tw = false; Iscn2tw = false;
//读取配置 //读取配置
string tmp = MyPath.Combine(path, getFileName(MyConfig.readString(MyConfig.TAG_MSE))); string tmp = MyPath.Combine(path, MyPath.getFileName(MSEConfig.TAG, MyConfig.readString(MyConfig.TAG_MSE)));
if (!File.Exists(tmp)) if (!File.Exists(tmp))
{ {
tmp = MyPath.Combine(path, getFileName(FILE_CONFIG_NAME)); tmp = MyPath.Combine(path, MyPath.getFileName(MSEConfig.TAG, FILE_CONFIG_NAME));
if(!File.Exists(tmp)) if(!File.Exists(tmp))
return;//如果默认的也不存在 return;//如果默认的也不存在
} }
SetConfig(tmp, path); SetConfig(tmp, path);
} }
public static string getFileName(string lang)
{
return "mse_" + lang + ".txt";
}
public static string getLanguage(string file)
{
string name = Path.GetFileNameWithoutExtension(file);
if (!name.StartsWith("mse_"))
return "";
else
return name.Replace("mse_", "");
}
//每个存档最大数 //每个存档最大数
public int maxcount; public int maxcount;
...@@ -150,6 +143,8 @@ public static string getLanguage(string file) ...@@ -150,6 +143,8 @@ public static string getLanguage(string file)
public string regx_monster; public string regx_monster;
//存档头部 //存档头部
public string head; public string head;
//存档结尾
public string end;
public Dictionary<long, string> typeDic; public Dictionary<long, string> typeDic;
public Dictionary<long, string> raceDic; public Dictionary<long, string> raceDic;
} }
......
...@@ -4,48 +4,150 @@ ...@@ -4,48 +4,150 @@
namespace DataEditorX.Config namespace DataEditorX.Config
{ {
class MyConfig /// <summary>
/// 配置
/// </summary>
public class MyConfig
{ {
#region 常量
/// <summary>
/// 窗口消息 打开文件
/// </summary>
public const int WM_OPEN = 0x0401; public const int WM_OPEN = 0x0401;
/// <summary>
/// 最大历史数量
/// </summary>
public const int MAX_HISTORY = 0x10; public const int MAX_HISTORY = 0x10;
/// <summary>
/// 数据目录
/// </summary>
public const string TAG_DATA = "data"; public const string TAG_DATA = "data";
/// <summary>
/// MSE
/// </summary>
public const string TAG_MSE = "mse"; public const string TAG_MSE = "mse";
/// <summary>
/// 卡片信息
/// </summary>
public const string TAG_CARDINFO = "cardinfo"; public const string TAG_CARDINFO = "cardinfo";
/// <summary>
/// 语言
/// </summary>
public const string TAG_LANGUAGE = "language"; public const string TAG_LANGUAGE = "language";
/// <summary>
/// 临时文件
/// </summary>
public const string FILE_TEMP = "open.tmp"; public const string FILE_TEMP = "open.tmp";
/// <summary>
/// 历史记录
/// </summary>
public const string FILE_HISTORY = "history.txt"; public const string FILE_HISTORY = "history.txt";
/// <summary>
/// 函数
/// </summary>
public const string FILE_FUNCTION = "_functions.txt"; public const string FILE_FUNCTION = "_functions.txt";
/// <summary>
/// 常量
/// </summary>
public const string FILE_CONSTANT = "constant.lua"; public const string FILE_CONSTANT = "constant.lua";
/// <summary>
/// 指示物,胜利提示
/// </summary>
public const string FILE_STRINGS = "strings.conf"; public const string FILE_STRINGS = "strings.conf";
/// <summary>
/// 源码链接
/// </summary>
public const string TAG_SOURCE_URL = "sourceURL"; public const string TAG_SOURCE_URL = "sourceURL";
/// <summary>
/// 升级链接
/// </summary>
public const string TAG_UPDATE_URL = "updateURL"; public const string TAG_UPDATE_URL = "updateURL";
/// <summary>
/// 一般的裁剪
/// </summary>
public const string TAG_IMAGE_OTHER = "image_other"; public const string TAG_IMAGE_OTHER = "image_other";
/// <summary>
/// xyz的裁剪
/// </summary>
public const string TAG_IMAGE_XYZ = "image_xyz"; public const string TAG_IMAGE_XYZ = "image_xyz";
/// <summary>
/// Pendulum的裁剪
/// </summary>
public const string TAG_IMAGE_PENDULUM = "image_pendulum"; public const string TAG_IMAGE_PENDULUM = "image_pendulum";
/// <summary>
/// 图片的宽高,小图w,h大图W,H,共4个
/// </summary>
public const string TAG_IMAGE_SIZE = "image"; public const string TAG_IMAGE_SIZE = "image";
/// <summary>
/// 图片质量
/// </summary>
public const string TAG_IMAGE_QUILTY = "image_quilty"; public const string TAG_IMAGE_QUILTY = "image_quilty";
//CodeEditor
/// <summary>
/// 字体名
/// </summary>
public const string TAG_FONT_NAME = "fontname"; public const string TAG_FONT_NAME = "fontname";
/// <summary>
/// 字体大小
/// </summary>
public const string TAG_FONT_SIZE = "fontsize"; public const string TAG_FONT_SIZE = "fontsize";
/// <summary>
/// 支持中文
/// </summary>
public const string TAG_IME = "IME"; public const string TAG_IME = "IME";
/// <summary>
/// 自动换行
/// </summary>
public const string TAG_WORDWRAP = "wordwrap"; public const string TAG_WORDWRAP = "wordwrap";
/// <summary>
/// tab替换为空格
/// </summary>
public const string TAG_TAB2SPACES = "tabisspace"; public const string TAG_TAB2SPACES = "tabisspace";
/// <summary>
/// 规则
/// </summary>
public const string TAG_RULE = "rule"; public const string TAG_RULE = "rule";
/// <summary>
/// 种族
/// </summary>
public const string TAG_RACE = "race"; public const string TAG_RACE = "race";
/// <summary>
/// 属性
/// </summary>
public const string TAG_ATTRIBUTE = "attribute"; public const string TAG_ATTRIBUTE = "attribute";
/// <summary>
/// 等级
/// </summary>
public const string TAG_LEVEL = "level"; public const string TAG_LEVEL = "level";
/// <summary>
/// 效果分类
/// </summary>
public const string TAG_CATEGORY = "category"; public const string TAG_CATEGORY = "category";
/// <summary>
/// 类型
/// </summary>
public const string TAG_TYPE = "type"; public const string TAG_TYPE = "type";
/// <summary>
/// 系列名
/// </summary>
public const string TAG_SETNAME = "setname"; public const string TAG_SETNAME = "setname";
#endregion
/// <summary>
/// 读取字符串值
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string readString(string key) public static string readString(string key)
{ {
return GetAppConfig(key); return GetAppConfig(key);
} }
/// <summary>
/// 读取int值
/// </summary>
/// <param name="key"></param>
/// <param name="def"></param>
/// <returns></returns>
public static int readInteger(string key, int def) public static int readInteger(string key, int def)
{ {
int i; int i;
...@@ -53,6 +155,12 @@ public static int readInteger(string key, int def) ...@@ -53,6 +155,12 @@ public static int readInteger(string key, int def)
return i; return i;
return def; return def;
} }
/// <summary>
/// 读取float值
/// </summary>
/// <param name="key"></param>
/// <param name="def"></param>
/// <returns></returns>
public static float readFloat(string key, float def) public static float readFloat(string key, float def)
{ {
float i; float i;
...@@ -60,6 +168,12 @@ public static float readFloat(string key, float def) ...@@ -60,6 +168,12 @@ public static float readFloat(string key, float def)
return i; return i;
return def; return def;
} }
/// <summary>
/// 读取int数组
/// </summary>
/// <param name="key"></param>
/// <param name="length"></param>
/// <returns></returns>
public static int[] readIntegers(string key, int length) public static int[] readIntegers(string key, int length)
{ {
string temp = readString(key); string temp = readString(key);
...@@ -75,6 +189,11 @@ public static int[] readIntegers(string key, int length) ...@@ -75,6 +189,11 @@ public static int[] readIntegers(string key, int length)
} }
return ints; return ints;
} }
/// <summary>
/// 读取区域
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static Area readArea(string key) public static Area readArea(string key)
{ {
int[] ints = readIntegers(key, 4); int[] ints = readIntegers(key, 4);
...@@ -88,6 +207,11 @@ public static Area readArea(string key) ...@@ -88,6 +207,11 @@ public static Area readArea(string key)
} }
return a; return a;
} }
/// <summary>
/// 读取boolean
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool readBoolean(string key) public static bool readBoolean(string key)
{ {
if (readString(key).ToLower() == "true") if (readString(key).ToLower() == "true")
...@@ -95,7 +219,11 @@ public static bool readBoolean(string key) ...@@ -95,7 +219,11 @@ public static bool readBoolean(string key)
else else
return false; return false;
} }
/// <summary>
/// 保存值
/// </summary>
/// <param name="appKey"></param>
/// <param name="appValue"></param>
public static void Save(string appKey, string appValue) public static void Save(string appKey, string appValue)
{ {
XmlDocument xDoc = new XmlDocument(); XmlDocument xDoc = new XmlDocument();
...@@ -115,6 +243,11 @@ public static void Save(string appKey, string appValue) ...@@ -115,6 +243,11 @@ public static void Save(string appKey, string appValue)
} }
xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config"); xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
} }
/// <summary>
/// 获取值
/// </summary>
/// <param name="appKey"></param>
/// <returns></returns>
public static string GetAppConfig(string appKey) public static string GetAppConfig(string appKey)
{ {
XmlDocument xDoc = new XmlDocument(); XmlDocument xDoc = new XmlDocument();
...@@ -130,13 +263,23 @@ public static string GetAppConfig(string appKey) ...@@ -130,13 +263,23 @@ public static string GetAppConfig(string appKey)
} }
return string.Empty; return string.Empty;
} }
/// <summary>
/// 语言配置文件名
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string GetLanguageFile(string path) public static string GetLanguageFile(string path)
{ {
return MyPath.Combine(path, MyConfig.TAG_LANGUAGE + "_" + GetAppConfig(TAG_LANGUAGE) + ".txt"); return MyPath.Combine(path, MyPath.getFileName(MyConfig.TAG_LANGUAGE, GetAppConfig(TAG_LANGUAGE)));
} }
/// <summary>
/// 卡片信息配置文件名
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string GetCardInfoFile(string path) public static string GetCardInfoFile(string path)
{ {
return MyPath.Combine(path, MyConfig.TAG_CARDINFO + "_" + GetAppConfig(TAG_LANGUAGE)+".txt"); return MyPath.Combine(path, MyPath.getFileName(MyConfig.TAG_CARDINFO, GetAppConfig(TAG_LANGUAGE)));
} }
} }
......
...@@ -29,7 +29,7 @@ protected override void OnMouseMove(MouseEventArgs e) ...@@ -29,7 +29,7 @@ protected override void OnMouseMove(MouseEventArgs e)
base.OnMouseMove(e); base.OnMouseMove(e);
lastMouseCoord = e.Location; lastMouseCoord = e.Location;
} }
//函数提示
protected override void OnToolTip() protected override void OnToolTip()
{ {
if (ToolTip == null) if (ToolTip == null)
...@@ -61,6 +61,7 @@ protected override void OnToolTip() ...@@ -61,6 +61,7 @@ protected override void OnToolTip()
ToolTip.Show(ea.ToolTipText, this, new Point(lastMouseCoord.X, lastMouseCoord.Y + CharHeight)); ToolTip.Show(ea.ToolTipText, this, new Point(lastMouseCoord.X, lastMouseCoord.Y + CharHeight));
} }
} }
//高亮当前词
void FctbTextChangedDelayed(object sender, TextChangedEventArgs e) void FctbTextChangedDelayed(object sender, TextChangedEventArgs e)
{ {
//delete all markers //delete all markers
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.IO; using System.IO;
using DataEditorX.Core; using DataEditorX.Core;
using DataEditorX.Config; using DataEditorX.Config;
...@@ -9,16 +8,8 @@ ...@@ -9,16 +8,8 @@
namespace DataEditorX.Controls namespace DataEditorX.Controls
{ {
interface IMainForm
{
void CdbMenuClear();
void LuaMenuClear();
void AddCdbMenu(ToolStripItem item);
void AddLuaMenu(ToolStripItem item);
void Open(string file);
}
class History public class History
{ {
IMainForm mainForm; IMainForm mainForm;
string historyFile; string historyFile;
......
using System.Windows.Forms;
namespace DataEditorX.Controls
{
public interface IMainForm
{
void CdbMenuClear();
void LuaMenuClear();
void AddCdbMenu(ToolStripItem item);
void AddLuaMenu(ToolStripItem item);
void Open(string file);
}
}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace FastColoredTextBoxNS namespace FastColoredTextBoxNS
{ {
/// <summary> /// <summary>
/// Description of FastColoredTextBoxEx. /// ygocore的lua高亮,夜间
/// </summary> /// </summary>
public class MySyntaxHighlighter : SyntaxHighlighter public class MySyntaxHighlighter : SyntaxHighlighter
{ {
......
...@@ -82,7 +82,11 @@ public override bool Equals(object obj) ...@@ -82,7 +82,11 @@ public override bool Equals(object obj)
else else
return false; return false;
} }
/// <summary>
/// 比较卡片,除脚本提示文本
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public bool EqualsData(Card other) public bool EqualsData(Card other)
{ {
bool equalBool = true; bool equalBool = true;
...@@ -157,12 +161,21 @@ public override int GetHashCode() ...@@ -157,12 +161,21 @@ public override int GetHashCode()
{ {
return left.Equals(right); return left.Equals(right);
} }
/// <summary>
/// 是否是某类型
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public bool IsType(CardType type){ public bool IsType(CardType type){
if((this.type & (long)type) == (long)type) if((this.type & (long)type) == (long)type)
return true; return true;
return false; return false;
} }
/// <summary>
/// 是否是某系列
/// </summary>
/// <param name="sc"></param>
/// <returns></returns>
public bool IsSetCode(long sc) public bool IsSetCode(long sc)
{ {
long settype = sc & 0xfff; long settype = sc & 0xfff;
...@@ -186,6 +199,9 @@ public bool IsSetCode(long sc) ...@@ -186,6 +199,9 @@ public bool IsSetCode(long sc)
#endregion #endregion
#region 卡片文字信息 #region 卡片文字信息
/// <summary>
/// 密码字符串
/// </summary>
public string idString public string idString
{ {
get { return id.ToString("00000000"); } get { return id.ToString("00000000"); }
...@@ -205,6 +221,12 @@ public override string ToString() ...@@ -205,6 +221,12 @@ public override string ToString()
str = name +"[" +idString +"]\n["+YGOUtil.GetTypeString(type)+"]\n"+redesc(); str = name +"[" +idString +"]\n["+YGOUtil.GetTypeString(type)+"]\n"+redesc();
return str; return str;
} }
public string ToShortString(){
return this.name+" ["+idString+"]";
}
public string ToLongString(){
return ToString();
}
string levelString() string levelString()
{ {
......
...@@ -9,17 +9,38 @@ ...@@ -9,17 +9,38 @@
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
/// <summary> /// <summary>
/// Description of CardAttribute. /// 卡片属性
/// </summary> /// </summary>
public enum CardAttribute : int public enum CardAttribute : int
{ {
ATTRIBUTE_EARTH =0x01 ,//--地 /// <summary>
ATTRIBUTE_WATER =0x02 ,//--水 /// 地
ATTRIBUTE_FIRE =0x04 ,//--炎 /// </summary>
ATTRIBUTE_WIND =0x08 ,//--风 ATTRIBUTE_EARTH = 0x01,
ATTRIBUTE_LIGHT =0x10 ,//--光 /// <summary>
ATTRIBUTE_DARK =0x20 ,//--暗 /// 水
ATTRIBUTE_DEVINE =0x40 ,//--神 /// </summary>
} ATTRIBUTE_WATER = 0x02,
/// <summary>
/// 炎
/// </summary>
ATTRIBUTE_FIRE = 0x04,
/// <summary>
/// 风
/// </summary>
ATTRIBUTE_WIND = 0x08,
/// <summary>
/// 光
/// </summary>
ATTRIBUTE_LIGHT = 0x10,
/// <summary>
/// 暗
/// </summary>
ATTRIBUTE_DARK = 0x20,
/// <summary>
/// 神
/// </summary>
ATTRIBUTE_DEVINE = 0x40,
}
} }
...@@ -9,34 +9,58 @@ ...@@ -9,34 +9,58 @@
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
/// <summary> /// <summary>
/// Description of CardEffect. /// 卡片种族
/// </summary> /// </summary>
public enum CardRace : long public enum CardRace : long
{ {
RACE_WARRIOR =0x1 ,//--战士 ///<summary>战士</summary>
RACE_SPELLCASTER =0x2 ,//--魔法师 RACE_WARRIOR = 0x1,
RACE_FAIRY =0x4 ,//--天使 ///<summary>魔法师</summary>
RACE_FIEND =0x8 ,//--恶魔 RACE_SPELLCASTER = 0x2,
RACE_ZOMBIE =0x10 ,//--不死 ///<summary>天使</summary>
RACE_MACHINE =0x20 ,//--机械 RACE_FAIRY = 0x4,
RACE_AQUA =0x40 ,//--水 ///<summary>恶魔</summary>
RACE_PYRO =0x80 ,//--炎 RACE_FIEND = 0x8,
RACE_ROCK =0x100 ,//--岩石 ///<summary>不死</summary>
RACE_WINDBEAST =0x200 ,//--鸟兽 RACE_ZOMBIE = 0x10,
RACE_PLANT =0x400 ,//--植物 ///<summary>机械</summary>
RACE_INSECT =0x800 ,//--昆虫 RACE_MACHINE = 0x20,
RACE_THUNDER =0x1000 ,//--雷 ///<summary>水</summary>
RACE_DRAGON =0x2000 ,//--龙 RACE_AQUA = 0x40,
RACE_BEAST =0x4000 ,//--兽 ///<summary>炎</summary>
RACE_BEASTWARRIOR =0x8000 ,//--兽战士 RACE_PYRO = 0x80,
RACE_DINOSAUR =0x10000 ,//--恐龙 ///<summary>岩石</summary>
RACE_FISH =0x20000 ,//--鱼 RACE_ROCK = 0x100,
RACE_SEASERPENT =0x40000 ,//--海龙 ///<summary>鸟兽</summary>
RACE_REPTILE =0x80000 ,//--爬虫 RACE_WINDBEAST = 0x200,
RACE_PSYCHO =0x100000 ,//--念动力 ///<summary>植物</summary>
RACE_DEVINE =0x200000 ,//--幻神兽 RACE_PLANT = 0x400,
RACE_CREATORGOD =0x400000 ,//--创造神 ///<summary>昆虫</summary>
RACE_WYRM =0x800000 ,//--幻龙 RACE_INSECT = 0x800,
} ///<summary>雷</summary>
RACE_THUNDER = 0x1000,
///<summary>龙</summary>
RACE_DRAGON = 0x2000,
///<summary>兽</summary>
RACE_BEAST = 0x4000,
///<summary>兽战士</summary>
RACE_BEASTWARRIOR = 0x8000,
///<summary>恐龙</summary>
RACE_DINOSAUR = 0x10000,
///<summary>鱼</summary>
RACE_FISH = 0x20000,
///<summary>海龙</summary>
RACE_SEASERPENT = 0x40000,
///<summary>爬虫</summary>
RACE_REPTILE = 0x80000,
///<summary>念动力</summary>
RACE_PSYCHO = 0x100000,
///<summary>幻神兽</summary>
RACE_DEVINE = 0x200000,
///<summary>创造神</summary>
RACE_CREATORGOD = 0x400000,
///<summary>幻龙</summary>
RACE_WYRM = 0x800000,
}
} }
...@@ -10,32 +10,56 @@ ...@@ -10,32 +10,56 @@
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
/// <summary> /// <summary>
/// Description of CardType. /// 卡片类型
/// </summary> /// </summary>
public enum CardType : long public enum CardType : long
{ {
TYPE_MONSTER =0x1 ,//--怪兽卡 ///<summary>怪兽卡</summary>
TYPE_SPELL =0x2 ,//--魔法卡 TYPE_MONSTER =0x1 ,
TYPE_TRAP =0x4 ,//--陷阱卡 ///<summary>魔法卡</summary>
TYPE_NORMAL =0x10 ,//--通常 TYPE_SPELL =0x2 ,
TYPE_EFFECT =0x20 ,//--效果 ///<summary>陷阱卡</summary>
TYPE_FUSION =0x40 ,//--融合 TYPE_TRAP =0x4 ,
TYPE_RITUAL =0x80 ,//--仪式 ///<summary>通常</summary>
TYPE_TRAPMONSTER =0x100 ,//--陷阱怪兽 TYPE_NORMAL =0x10 ,
TYPE_SPIRIT =0x200 ,//--灵魂 ///<summary>效果</summary>
TYPE_UNION =0x400 ,//--同盟 TYPE_EFFECT =0x20 ,
TYPE_DUAL =0x800 ,//--二重 ///<summary>融合</summary>
TYPE_TUNER =0x1000 ,//--调整 TYPE_FUSION =0x40 ,
TYPE_SYNCHRO =0x2000 ,//--同调 ///<summary>仪式</summary>
TYPE_TOKEN =0x4000 ,//--衍生物 TYPE_RITUAL =0x80 ,
TYPE_QUICKPLAY =0x10000 ,//--速攻 ///<summary>陷阱怪兽</summary>
TYPE_CONTINUOUS =0x20000 ,//--永续 TYPE_TRAPMONSTER =0x100 ,
TYPE_EQUIP =0x40000 ,//--装备 ///<summary>灵魂</summary>
TYPE_FIELD =0x80000 ,//--场地 TYPE_SPIRIT =0x200 ,
TYPE_COUNTER =0x100000 ,//--反击 ///<summary>同盟</summary>
TYPE_FLIP =0x200000 ,//--翻转 TYPE_UNION =0x400 ,
TYPE_TOON =0x400000 ,//--卡通 ///<summary>二重</summary>
TYPE_XYZ =0x800000 ,//--超量 TYPE_DUAL =0x800 ,
TYPE_PENDULUM =0x1000000 ,//--摇摆 ///<summary>调整</summary>
TYPE_TUNER =0x1000 ,
///<summary>同调</summary>
TYPE_SYNCHRO =0x2000 ,
///<summary>衍生物</summary>
TYPE_TOKEN =0x4000 ,
///<summary>速攻</summary>
TYPE_QUICKPLAY =0x10000 ,
///<summary>永续</summary>
TYPE_CONTINUOUS =0x20000 ,
///<summary>装备</summary>
TYPE_EQUIP =0x40000 ,
///<summary>场地</summary>
TYPE_FIELD =0x80000 ,
///<summary>反击</summary>
TYPE_COUNTER =0x100000 ,
///<summary>翻转</summary>
TYPE_FLIP =0x200000 ,
///<summary>卡通</summary>
TYPE_TOON =0x400000 ,
///<summary>超量</summary>
TYPE_XYZ =0x800000 ,
///<summary>摇摆</summary>
TYPE_PENDULUM =0x1000000 ,
} }
} }
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
/// <summary> /// <summary>
/// Description of SQLite. /// SQLite 操作
/// </summary> /// </summary>
public static class DataBase public static class DataBase
{ {
...@@ -107,7 +107,7 @@ public static int Command(string DB, params string[] SQLs) ...@@ -107,7 +107,7 @@ public static int Command(string DB, params string[] SQLs)
} }
catch catch
{ {
trans.Rollback(); trans.Rollback();//出错,回滚
result = -1; result = -1;
} }
finally finally
......
...@@ -19,10 +19,7 @@ namespace DataEditorX ...@@ -19,10 +19,7 @@ namespace DataEditorX
/// </summary> /// </summary>
public class LuaFunction public class LuaFunction
{ {
#region log #region 日志log
static string oldfun;
static string logtxt;
static string funclisttxt;
static void ResetLog(string file) static void ResetLog(string file)
{ {
File.Delete(logtxt); File.Delete(logtxt);
...@@ -33,13 +30,16 @@ static void Log(string str) ...@@ -33,13 +30,16 @@ static void Log(string str)
} }
#endregion #endregion
#region old functions #region old functions
static string oldfun;
static string logtxt;
static string funclisttxt;
static SortedList<string,string> funclist=new SortedList<string,string>(); static SortedList<string,string> funclist=new SortedList<string,string>();
public static SortedList<string,string> Read(string funtxt) //读取旧函数
public static void Read(string funtxt)
{ {
funclist.Clear(); funclist.Clear();
oldfun=funtxt; oldfun=funtxt;
SortedList<string,string> list=new SortedList<string,string>();
if(File.Exists(funtxt)) if(File.Exists(funtxt))
{ {
string[] lines=File.ReadAllLines(funtxt); string[] lines=File.ReadAllLines(funtxt);
...@@ -54,21 +54,11 @@ static void Log(string str) ...@@ -54,21 +54,11 @@ static void Log(string str)
continue; continue;
if(line.StartsWith("●")) if(line.StartsWith("●"))
{ {
//add //添加之前的函数
if(!string.IsNullOrEmpty(name)) AddOldFun(name, desc);
{
if(list.ContainsKey(name)){
list[name] +=Environment.NewLine+desc;
funclist[name] +=Environment.NewLine+desc;
}
else{
list.Add(name, desc);
funclist.Add(name, desc);
}
}
int w=line.IndexOf("("); int w=line.IndexOf("(");
int t=line.IndexOf(" "); int t=line.IndexOf(" ");
//获取当前名字
if(t<w && t>0){ if(t<w && t>0){
name=line.Substring(t+1,w-t-1); name=line.Substring(t+1,w-t-1);
isFind=true; isFind=true;
...@@ -79,40 +69,32 @@ static void Log(string str) ...@@ -79,40 +69,32 @@ static void Log(string str)
desc+=Environment.NewLine+line; desc+=Environment.NewLine+line;
} }
} }
if(!string.IsNullOrEmpty(name)) AddOldFun(name, desc);
{
if(list.ContainsKey(name)){
list[name] +=Environment.NewLine+desc;
funclist[name] +=Environment.NewLine+desc;
}
else{
list.Add(name, desc);
funclist.Add(name, desc);
}
}
} }
return list; //return list;
} }
static void AddOldFun(string name, string desc)
{
if (!string.IsNullOrEmpty(name))
{
if (funclist.ContainsKey(name))//存在,则添加注释
{
funclist[name] += Environment.NewLine + desc;
}
else
{//不存在,则添加函数
funclist.Add(name, desc);
}
}
}
#endregion #endregion
static void Save()
{
if(string.IsNullOrEmpty(oldfun))
return;
using(FileStream fs=new FileStream(oldfun+"_sort.txt",
FileMode.Create,
FileAccess.Write))
{
StreamWriter sw=new StreamWriter(fs,Encoding.UTF8);
foreach(string k in funclist.Keys)
{
sw.WriteLine("●"+funclist[k]);
}
sw.Close();
}
}
#region find libs #region find libs
/// <summary>
/// 查找lua函数
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static bool Find(string path) public static bool Find(string path)
{ {
string name="interpreter.cpp"; string name="interpreter.cpp";
...@@ -122,7 +104,7 @@ public static bool Find(string path) ...@@ -122,7 +104,7 @@ public static bool Find(string path)
ResetLog(logtxt); ResetLog(logtxt);
funclisttxt =Path.Combine(path, "_functions.txt"); funclisttxt =Path.Combine(path, "_functions.txt");
File.Delete(funclisttxt); File.Delete(funclisttxt);
if(!File.Exists(file)){ if(!File.Exists(file)){//判断用户选择的目录
Log("error: no find file "+file); Log("error: no find file "+file);
if(File.Exists(file2)){ if(File.Exists(file2)){
file=file2; file=file2;
...@@ -138,11 +120,12 @@ public static bool Find(string path) ...@@ -138,11 +120,12 @@ public static bool Find(string path)
,RegexOptions.Multiline); ,RegexOptions.Multiline);
MatchCollection libsMatch=libRex.Matches(texts); MatchCollection libsMatch=libRex.Matches(texts);
Log("log:count "+libsMatch.Count.ToString()); Log("log:count "+libsMatch.Count.ToString());
foreach ( Match m in libsMatch ) foreach ( Match m in libsMatch )//获取lib函数库
{ {
if(m.Groups.Count>2){ if(m.Groups.Count>2){
string word=m.Groups[1].Value; string word=m.Groups[1].Value;
Log("log:find "+word); Log("log:find "+word);
//分别去获取函数库的函数
GetFunctions(word, m.Groups[2].Value, GetFunctions(word, m.Groups[2].Value,
Path.Combine(path,"lib"+word+".cpp")); Path.Combine(path,"lib"+word+".cpp"));
} }
...@@ -150,6 +133,24 @@ public static bool Find(string path) ...@@ -150,6 +133,24 @@ public static bool Find(string path)
Save(); Save();
return true; return true;
} }
//保存
static void Save()
{
if (string.IsNullOrEmpty(oldfun))
return;
using (FileStream fs = new FileStream(oldfun + "_sort.txt",
FileMode.Create,
FileAccess.Write))
{
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
foreach (string k in funclist.Keys)
{
sw.WriteLine("●" + funclist[k]);
}
sw.Close();
}
}
#endregion #endregion
#region find function name #region find function name
...@@ -157,6 +158,7 @@ static string ToTitle(string str) ...@@ -157,6 +158,7 @@ static string ToTitle(string str)
{ {
return str.Substring(0, 1).ToUpper()+str.Substring(1); return str.Substring(0, 1).ToUpper()+str.Substring(1);
} }
//获取函数库的lua函数名,和对应的c++函数
static Dictionary<string,string> GetFunctionNames(string texts,string name) static Dictionary<string,string> GetFunctionNames(string texts,string name)
{ {
Dictionary<string,string> dic=new Dictionary<string, string>(); Dictionary<string,string> dic=new Dictionary<string, string>();
...@@ -178,6 +180,7 @@ static string ToTitle(string str) ...@@ -178,6 +180,7 @@ static string ToTitle(string str)
#endregion #endregion
#region find code #region find code
//查找c++代码
static string FindCode(string texts,string name) static string FindCode(string texts,string name)
{ {
Regex reg=new Regex(@"int32\s+?"+name Regex reg=new Regex(@"int32\s+?"+name
...@@ -197,6 +200,7 @@ static string FindCode(string texts,string name) ...@@ -197,6 +200,7 @@ static string FindCode(string texts,string name)
#endregion #endregion
#region find return #region find return
//查找返回类型
static string FindReturn(string texts,string name) static string FindReturn(string texts,string name)
{ {
string restr=""; string restr="";
...@@ -228,6 +232,7 @@ static string FindReturn(string texts,string name) ...@@ -228,6 +232,7 @@ static string FindReturn(string texts,string name)
#endregion #endregion
#region find args #region find args
//查找参数
static string getUserType(string str) static string getUserType(string str)
{ {
if(str.IndexOf("card")>=0) if(str.IndexOf("card")>=0)
...@@ -301,6 +306,7 @@ static string FindArgs(string texts,string name) ...@@ -301,6 +306,7 @@ static string FindArgs(string texts,string name)
#endregion #endregion
#region find old #region find old
//查找旧函数的描述
static string FindOldDesc(string name) static string FindOldDesc(string name)
{ {
if(funclist.ContainsKey(name)) if(funclist.ContainsKey(name))
...@@ -310,6 +316,7 @@ static string FindOldDesc(string name) ...@@ -310,6 +316,7 @@ static string FindOldDesc(string name)
#endregion #endregion
#region Save Functions #region Save Functions
//保存函数
public static void GetFunctions(string name,string texts,string file) public static void GetFunctions(string name,string texts,string file)
{ {
if(!File.Exists(file)){ if(!File.Exists(file)){
......
...@@ -15,22 +15,25 @@ ...@@ -15,22 +15,25 @@
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
/// <summary> /// <summary>
/// Description of MSE. /// MSE制作
/// </summary> /// </summary>
public class MseMaker public class MseMaker
{ {
#region 常量
public const string TAG_CARD = "card"; public const string TAG_CARD = "card";
public const string TAG_CARDTYPE = "card type"; public const string TAG_CARDTYPE = "card type";
public const string TAG_NAME = "name"; public const string TAG_NAME = "name";
public const string TAG_ATTRIBUTE = "attribute"; public const string TAG_ATTRIBUTE = "attribute";
public const string TAG_LEVEL = "level"; public const string TAG_LEVEL = "level";
public const string TAG_IMAGE = "image"; public const string TAG_IMAGE = "image";
/// <summary>种族</summary>
public const string TAG_TYPE1 = "type 1"; public const string TAG_TYPE1 = "type 1";
/// <summary>效果1</summary>
public const string TAG_TYPE2 = "type 2"; public const string TAG_TYPE2 = "type 2";
/// <summary>效果2/summary>
public const string TAG_TYPE3 = "type 3"; public const string TAG_TYPE3 = "type 3";
/// <summary>效果3</summary>
public const string TAG_TYPE4 = "type 4"; public const string TAG_TYPE4 = "type 4";
public const string TAG_TEXT = "rule text"; public const string TAG_TEXT = "rule text";
public const string TAG_ATK = "attack"; public const string TAG_ATK = "attack";
...@@ -40,14 +43,41 @@ public class MseMaker ...@@ -40,14 +43,41 @@ public class MseMaker
public const string TAG_PSCALE2 = "pendulum scale 2"; public const string TAG_PSCALE2 = "pendulum scale 2";
public const string TAG_PEND_TEXT = "pendulum text"; public const string TAG_PEND_TEXT = "pendulum text";
public const string TAG_CODE = "gamecode"; public const string TAG_CODE = "gamecode";
/// <summary>无</summary>
public const string KEY_ATTRIBUTE_NONE = "none"; public const string KEY_ATTRIBUTE_NONE = "none";
/// <summary>暗</summary>
public const string KEY_ATTRIBUTE_DARK = "dark"; public const string KEY_ATTRIBUTE_DARK = "dark";
/// <summary>神</summary>
public const string KEY_ATTRIBUTE_DIVINE = "divine"; public const string KEY_ATTRIBUTE_DIVINE = "divine";
/// <summary>地</summary>
public const string KEY_ATTRIBUTE_EARTH = "earth"; public const string KEY_ATTRIBUTE_EARTH = "earth";
/// <summary>火</summary>
public const string KEY_ATTRIBUTE_FIRE = "fire"; public const string KEY_ATTRIBUTE_FIRE = "fire";
/// <summary>光</summary>
public const string KEY_ATTRIBUTE_LIGHT = "light"; public const string KEY_ATTRIBUTE_LIGHT = "light";
/// <summary>水</summary>
public const string KEY_ATTRIBUTE_WATER = "water"; public const string KEY_ATTRIBUTE_WATER = "water";
/// <summary>风</summary>
public const string KEY_ATTRIBUTE_WIND = "wind"; public const string KEY_ATTRIBUTE_WIND = "wind";
/// <summary>通常</summary>
public const string CARD_NORMAL = "normal monster";
/// <summary>效果</summary>
public const string CARD_EFFECT = "effect monster";
/// <summary>超量</summary>
public const string CARD_XYZ = "xyz monster";
/// <summary>仪式</summary>
public const string CARD_RITUAL = "ritual monster";
/// <summary>融合</summary>
public const string CARD_FUSION = "fusion monster";
/// <summary>衍生物</summary>
public const string CARD_TOKEN = "token monster";
/// <summary>衍生物无种族</summary>
public const string CARD_TOKEN2 = "token card";
/// <summary>同调</summary>
public const string CARD_SYNCHRO = "synchro monster";
#endregion
#region 成员,初始化 #region 成员,初始化
MSEConfig cfg; MSEConfig cfg;
public int MaxNum public int MaxNum
...@@ -130,6 +160,7 @@ public string GetST(Card c, bool isSpell) ...@@ -130,6 +160,7 @@ public string GetST(Card c, bool isSpell)
//获取图片路径 //获取图片路径
public static string GetCardImagePath(string picpath, Card c) public static string GetCardImagePath(string picpath, Card c)
{ {
//密码,带0密码,卡名
string jpg = MyPath.Combine(picpath, c.id + ".jpg"); string jpg = MyPath.Combine(picpath, c.id + ".jpg");
string jpg2 = MyPath.Combine(picpath, c.idString + ".jpg"); string jpg2 = MyPath.Combine(picpath, c.idString + ".jpg");
string jpg3 = MyPath.Combine(picpath, c.name + ".jpg"); string jpg3 = MyPath.Combine(picpath, c.name + ".jpg");
...@@ -254,42 +285,45 @@ public string GetType(CardType ctype) ...@@ -254,42 +285,45 @@ public string GetType(CardType ctype)
//获取卡片类型 //获取卡片类型
public string[] GetTypes(Card c) public string[] GetTypes(Card c)
{ {
string[] types = new string[] { "normal monster", "", "", "" }; //卡片类型,效果1,效果2,效果3
string[] types = new string[] { CARD_NORMAL, "", "", "" };
if (c.IsType(CardType.TYPE_MONSTER)) if (c.IsType(CardType.TYPE_MONSTER))
{//卡片类型和第1效果 {//卡片类型和第1效果
if (c.IsType(CardType.TYPE_XYZ)) if (c.IsType(CardType.TYPE_XYZ))
{ {
types[0] = "xyz monster"; types[0] = CARD_XYZ;
types[1] = GetType(CardType.TYPE_XYZ); types[1] = GetType(CardType.TYPE_XYZ);
} }
else if (c.IsType(CardType.TYPE_TOKEN)) else if (c.IsType(CardType.TYPE_TOKEN))
{ {
types[0] = (c.race == 0) ? "token card" : "token monster"; types[0] = (c.race == 0) ? CARD_TOKEN2
: CARD_TOKEN;
types[1] = GetType(CardType.TYPE_TOKEN); types[1] = GetType(CardType.TYPE_TOKEN);
} }
else if (c.IsType(CardType.TYPE_RITUAL)) else if (c.IsType(CardType.TYPE_RITUAL))
{ {
types[0] = "ritual monster"; types[0] = CARD_RITUAL;
types[1] = GetType(CardType.TYPE_RITUAL); types[1] = GetType(CardType.TYPE_RITUAL);
} }
else if (c.IsType(CardType.TYPE_FUSION)) else if (c.IsType(CardType.TYPE_FUSION))
{ {
types[0] = "fusion monster"; types[0] = CARD_FUSION;
types[1] = GetType(CardType.TYPE_FUSION); types[1] = GetType(CardType.TYPE_FUSION);
} }
else if (c.IsType(CardType.TYPE_SYNCHRO)) else if (c.IsType(CardType.TYPE_SYNCHRO))
{ {
types[0] = "synchro monster"; types[0] = CARD_SYNCHRO;
types[1] = GetType(CardType.TYPE_SYNCHRO); types[1] = GetType(CardType.TYPE_SYNCHRO);
} }
else if (c.IsType(CardType.TYPE_EFFECT)) else if (c.IsType(CardType.TYPE_EFFECT))
{ {
types[0] = "effect monster"; types[0] = CARD_EFFECT;
} }
else else
types[0] = "normal monster"; types[0] = CARD_NORMAL;
//同调 //同调
if (types[0] == "synchro monster" || types[0] == "token monster") if (types[0] == CARD_SYNCHRO
|| types[0] == CARD_TOKEN)
{ {
if (c.IsType(CardType.TYPE_TUNER) if (c.IsType(CardType.TYPE_TUNER)
&& c.IsType(CardType.TYPE_EFFECT)) && c.IsType(CardType.TYPE_EFFECT))
...@@ -306,14 +340,14 @@ public string[] GetTypes(Card c) ...@@ -306,14 +340,14 @@ public string[] GetTypes(Card c)
types[2] = GetType(CardType.TYPE_EFFECT); types[2] = GetType(CardType.TYPE_EFFECT);
} }
} }
else if (types[0] == "normal monster") else if (types[0] == CARD_NORMAL)
{ {
if (c.IsType(CardType.TYPE_PENDULUM))//灵摆 if (c.IsType(CardType.TYPE_PENDULUM))//灵摆
types[1] = GetType(CardType.TYPE_PENDULUM); types[1] = GetType(CardType.TYPE_PENDULUM);
else if (c.IsType(CardType.TYPE_TUNER))//调整 else if (c.IsType(CardType.TYPE_TUNER))//调整
types[1] = GetType(CardType.TYPE_TUNER); types[1] = GetType(CardType.TYPE_TUNER);
} }
else if (types[0] != "effect monster") else if (types[0] != CARD_EFFECT)
{//效果 {//效果
if (c.IsType(CardType.TYPE_EFFECT)) if (c.IsType(CardType.TYPE_EFFECT))
types[2] = GetType(CardType.TYPE_EFFECT); types[2] = GetType(CardType.TYPE_EFFECT);
...@@ -343,7 +377,7 @@ public string[] GetTypes(Card c) ...@@ -343,7 +377,7 @@ public string[] GetTypes(Card c)
} }
} }
if (c.race == 0) if (c.race == 0)//如果没有种族
{ {
types[1] = ""; types[1] = "";
types[2] = ""; types[2] = "";
...@@ -397,7 +431,7 @@ string getMonster(Card c, string img, bool isPendulum) ...@@ -397,7 +431,7 @@ string getMonster(Card c, string img, bool isPendulum)
sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1]))); sb.AppendLine(GetLine(TAG_TYPE2, cn2tw(types[1])));
sb.AppendLine(GetLine(TAG_TYPE3, cn2tw(types[2]))); sb.AppendLine(GetLine(TAG_TYPE3, cn2tw(types[2])));
sb.AppendLine(GetLine(TAG_TYPE4, cn2tw(types[3]))); sb.AppendLine(GetLine(TAG_TYPE4, cn2tw(types[3])));
if (isPendulum) if (isPendulum)//P怪兽
{ {
string text = GetDesc(c.desc, cfg.regx_monster); string text = GetDesc(c.desc, cfg.regx_monster);
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
...@@ -411,7 +445,7 @@ string getMonster(Card c, string img, bool isPendulum) ...@@ -411,7 +445,7 @@ string getMonster(Card c, string img, bool isPendulum)
sb.AppendLine(" " + TAG_PEND_TEXT + ":"); sb.AppendLine(" " + TAG_PEND_TEXT + ":");
sb.AppendLine(" "+GetDesc(c.desc, cfg.regx_pendulum)); sb.AppendLine(" "+GetDesc(c.desc, cfg.regx_pendulum));
} }
else else//一般怪兽
{ {
sb.AppendLine(" " + TAG_TEXT + ":"); sb.AppendLine(" " + TAG_TEXT + ":");
sb.AppendLine(" " + ReText(c.desc)); sb.AppendLine(" " + ReText(c.desc));
......
...@@ -23,34 +23,67 @@ namespace DataEditorX.Core ...@@ -23,34 +23,67 @@ namespace DataEditorX.Core
{ {
public enum MyTask public enum MyTask
{ {
///<summary>空</summary>
NONE, NONE,
///<summary>检查更新</summary>
CheckUpdate, CheckUpdate,
///<summary>导出数据</summary>
ExportData, ExportData,
///<summary>保存为MSE存档</summary>
SaveAsMSE, SaveAsMSE,
///<summary>裁剪图片</summary>
CutImages, CutImages,
///<summary>转换图片</summary>
ConvertImages, ConvertImages,
} }
/// <summary> /// <summary>
/// Description of TaskHelper. /// 任务
/// </summary> /// </summary>
public class TaskHelper public class TaskHelper
{ {
#region Member #region Member
/// <summary>
/// 当前任务
/// </summary>
private MyTask nowTask = MyTask.NONE; private MyTask nowTask = MyTask.NONE;
/// <summary>
/// 上一次任务
/// </summary>
private MyTask lastTask = MyTask.NONE; private MyTask lastTask = MyTask.NONE;
/// <summary>
/// 当前卡片列表
/// </summary>
private Card[] cardlist; private Card[] cardlist;
/// <summary>
/// 任务参数
/// </summary>
private string[] mArgs; private string[] mArgs;
private ImageSet imgSet = new ImageSet(); /// <summary>
/// 图片设置
/// </summary>
private ImageSet imgSet;
/// <summary>
/// MSE转换
/// </summary>
private MseMaker mseHelper; private MseMaker mseHelper;
/// <summary>
/// 是否取消
/// </summary>
private bool isCancel = false; private bool isCancel = false;
/// <summary>
/// 是否在运行
/// </summary>
private bool isRun = false; private bool isRun = false;
/// <summary>
/// 后台工作线程
/// </summary>
private BackgroundWorker worker; private BackgroundWorker worker;
public TaskHelper(string datapath, BackgroundWorker worker, MSEConfig mcfg) public TaskHelper(string datapath, BackgroundWorker worker, MSEConfig mcfg)
{ {
this.worker = worker; this.worker = worker;
mseHelper = new MseMaker(mcfg); mseHelper = new MseMaker(mcfg);
imgSet.Init(); imgSet = new ImageSet();
} }
public MseMaker MseHelper public MseMaker MseHelper
{ {
...@@ -75,12 +108,14 @@ public MyTask getLastTask() ...@@ -75,12 +108,14 @@ public MyTask getLastTask()
#endregion #endregion
#region Other #region Other
//设置任务
public void SetTask(MyTask myTask, Card[] cards, params string[] args) public void SetTask(MyTask myTask, Card[] cards, params string[] args)
{ {
nowTask = myTask; nowTask = myTask;
cardlist = cards; cardlist = cards;
mArgs = args; mArgs = args;
} }
//转换图片
public void ToImg(string img, string saveimg1, string saveimg2) public void ToImg(string img, string saveimg1, string saveimg2)
{ {
if (!File.Exists(img)) if (!File.Exists(img))
...@@ -147,15 +182,15 @@ public void CutImages(string imgpath, bool isreplace) ...@@ -147,15 +182,15 @@ public void CutImages(string imgpath, bool isreplace)
{ {
Bitmap bp = new Bitmap(jpg); Bitmap bp = new Bitmap(jpg);
Bitmap bmp = null; Bitmap bmp = null;
if (c.IsType(CardType.TYPE_XYZ)) if (c.IsType(CardType.TYPE_XYZ))//超量
{ {
bmp = MyBitmap.Cut(bp, imgSet.xyzArea); bmp = MyBitmap.Cut(bp, imgSet.xyzArea);
} }
else if (c.IsType(CardType.TYPE_PENDULUM)) else if (c.IsType(CardType.TYPE_PENDULUM))//P怪兽
{ {
bmp = MyBitmap.Cut(bp, imgSet.pendulumArea); bmp = MyBitmap.Cut(bp, imgSet.pendulumArea);
} }
else else//一般
{ {
bmp = MyBitmap.Cut(bp, imgSet.normalArea); bmp = MyBitmap.Cut(bp, imgSet.normalArea);
} }
...@@ -189,14 +224,15 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace) ...@@ -189,14 +224,15 @@ public void ConvertImages(string imgpath, string gamepath, bool isreplace)
{ {
if (File.Exists(f)) if (File.Exists(f))
{ {
//存在大图
Bitmap bmp = new Bitmap(f); Bitmap bmp = new Bitmap(f);
//大图,如果替换,或者不存在
if (isreplace || !File.Exists(jpg_b)) if (isreplace || !File.Exists(jpg_b))
{ {
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.W, imgSet.H), MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.W, imgSet.H),
jpg_b, imgSet.quilty); jpg_b, imgSet.quilty);
} }
//小图,如果替换,或者不存在
if (isreplace || !File.Exists(jpg_s)) if (isreplace || !File.Exists(jpg_s))
{ {
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h), MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
...@@ -216,16 +252,19 @@ public string MSEImage ...@@ -216,16 +252,19 @@ public string MSEImage
} }
public void SaveMSEs(string file, Card[] cards, bool isUpdate) public void SaveMSEs(string file, Card[] cards, bool isUpdate)
{ {
if (mseHelper.MaxNum == 0) if(cards == null)
return;
int c = cards.Length;
//不分开,或者卡片数小于单个存档的最大值
if (mseHelper.MaxNum == 0 || c < mseHelper.MaxNum)
SaveMSE(1, file, cards, isUpdate); SaveMSE(1, file, cards, isUpdate);
else else
{ {
int c = cards.Length;
int nums = c / mseHelper.MaxNum; int nums = c / mseHelper.MaxNum;
if (nums * mseHelper.MaxNum < c) if (nums * mseHelper.MaxNum < c)//计算需要分多少个存档
nums++; nums++;
List<Card> clist = new List<Card>(); List<Card> clist = new List<Card>();
for (int i = 0; i < nums; i++) for (int i = 0; i < nums; i++)//分别生成存档
{ {
clist.Clear(); clist.Clear();
for (int j = 0; j < mseHelper.MaxNum; j++) for (int j = 0; j < mseHelper.MaxNum; j++)
...@@ -251,7 +290,7 @@ public void SaveMSE(int num, string file, Card[] cards, bool isUpdate) ...@@ -251,7 +290,7 @@ public void SaveMSE(int num, string file, Card[] cards, bool isUpdate)
int count = images.Length; int count = images.Length;
using (ZipStorer zips = ZipStorer.Create(file, "")) using (ZipStorer zips = ZipStorer.Create(file, ""))
{ {
zips.EncodeUTF8 = true; zips.EncodeUTF8 = true;//zip里面的文件名为utf8
zips.AddFile(setFile, "set", ""); zips.AddFile(setFile, "set", "");
foreach (string img in images) foreach (string img in images)
{ {
...@@ -276,8 +315,11 @@ public void ExportData(string zipname) ...@@ -276,8 +315,11 @@ public void ExportData(string zipname)
int count = cards.Length; int count = cards.Length;
string path = Path.GetDirectoryName(zipname); string path = Path.GetDirectoryName(zipname);
string name = Path.GetFileNameWithoutExtension(zipname); string name = Path.GetFileNameWithoutExtension(zipname);
//数据库
string cdbfile = zipname + ".cdb"; string cdbfile = zipname + ".cdb";
//说明
string readme = MyPath.Combine(path, name + ".txt"); string readme = MyPath.Combine(path, name + ".txt");
//新卡ydk
string deckydk = MyPath.Combine(path, "deck/" + name + ".ydk"); string deckydk = MyPath.Combine(path, "deck/" + name + ".ydk");
string pics = MyPath.Combine(path, "pics"); string pics = MyPath.Combine(path, "pics");
string thumb = MyPath.Combine(pics, "thumbnail"); string thumb = MyPath.Combine(pics, "thumbnail");
......
This diff is collapsed.
This diff is collapsed.
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
<Compile Include="Common\MyPath.cs" /> <Compile Include="Common\MyPath.cs" />
<Compile Include="Controls\History.cs" /> <Compile Include="Controls\History.cs" />
<Compile Include="Controls\IEditForm.cs" /> <Compile Include="Controls\IEditForm.cs" />
<Compile Include="Controls\IMainForm.cs" />
<Compile Include="Controls\MySyntaxHighlighter.cs" /> <Compile Include="Controls\MySyntaxHighlighter.cs" />
<Compile Include="Common\MyBitmap.cs" /> <Compile Include="Common\MyBitmap.cs" />
<Compile Include="Common\User32.cs" /> <Compile Include="Common\User32.cs" />
......
...@@ -56,7 +56,6 @@ private void InitializeComponent() ...@@ -56,7 +56,6 @@ private void InitializeComponent()
this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_save = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_save = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_findluafunc = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_copyselect = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_copyselect = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_copyall = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_copyall = new System.Windows.Forms.ToolStripMenuItem();
...@@ -153,7 +152,6 @@ private void InitializeComponent() ...@@ -153,7 +152,6 @@ private void InitializeComponent()
this.menuitem_open, this.menuitem_open,
this.menuitem_new, this.menuitem_new,
this.menuitem_save, this.menuitem_save,
this.menuitem_findluafunc,
this.toolStripSeparator3, this.toolStripSeparator3,
this.menuitem_copyselect, this.menuitem_copyselect,
this.menuitem_copyall, this.menuitem_copyall,
...@@ -194,13 +192,6 @@ private void InitializeComponent() ...@@ -194,13 +192,6 @@ private void InitializeComponent()
this.menuitem_save.Text = "Save"; this.menuitem_save.Text = "Save";
this.menuitem_save.Click += new System.EventHandler(this.Menuitem_saveClick); this.menuitem_save.Click += new System.EventHandler(this.Menuitem_saveClick);
// //
// menuitem_findluafunc
//
this.menuitem_findluafunc.Name = "menuitem_findluafunc";
this.menuitem_findluafunc.Size = new System.Drawing.Size(261, 22);
this.menuitem_findluafunc.Text = "Find LuaFunctons";
this.menuitem_findluafunc.Click += new System.EventHandler(this.Menuitem_findluafuncClick);
//
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
...@@ -357,8 +348,7 @@ private void InitializeComponent() ...@@ -357,8 +348,7 @@ private void InitializeComponent()
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.ToolStripMenuItem menuitem_findluafunc;
private System.Windows.Forms.ToolStripMenuItem menuitem_save; private System.Windows.Forms.ToolStripMenuItem menuitem_save;
private System.Windows.Forms.ToolStripMenuItem menuitem_codeeditor; private System.Windows.Forms.ToolStripMenuItem menuitem_codeeditor;
private System.Windows.Forms.ToolStripMenuItem menuitem_copyall; private System.Windows.Forms.ToolStripMenuItem menuitem_copyall;
......
...@@ -26,8 +26,6 @@ public partial class MainForm : Form, IMainForm ...@@ -26,8 +26,6 @@ public partial class MainForm : Form, IMainForm
string datapath; string datapath;
//语言配置 //语言配置
string conflang; string conflang;
//函数列表
string funtxt;
//数据库对比 //数据库对比
DataEditForm compare1, compare2; DataEditForm compare1, compare2;
//临时卡片 //临时卡片
...@@ -55,7 +53,7 @@ public void SetDataPath(string datapath) ...@@ -55,7 +53,7 @@ public void SetDataPath(string datapath)
YGOUtil.SetConfig(datacfg); YGOUtil.SetConfig(datacfg);
//代码提示 //代码提示
funtxt = MyPath.Combine(datapath, MyConfig.FILE_FUNCTION); string funtxt = MyPath.Combine(datapath, MyConfig.FILE_FUNCTION);
string conlua = MyPath.Combine(datapath, MyConfig.FILE_CONSTANT); string conlua = MyPath.Combine(datapath, MyConfig.FILE_CONSTANT);
string confstring = MyPath.Combine(datapath, MyConfig.FILE_STRINGS); string confstring = MyPath.Combine(datapath, MyConfig.FILE_STRINGS);
codecfg = new CodeConfig(); codecfg = new CodeConfig();
...@@ -125,9 +123,10 @@ protected override void DefWndProc(ref System.Windows.Forms.Message m) ...@@ -125,9 +123,10 @@ protected override void DefWndProc(ref System.Windows.Forms.Message m)
if (File.Exists(file)) if (File.Exists(file))
{ {
this.Activate(); this.Activate();
String openfile = File.ReadAllText(file);
//获取需要打开的文件路径 //获取需要打开的文件路径
Open(File.ReadAllText(file)); Open(openfile);
File.Delete(file); //File.Delete(file);
} }
break; break;
default: default:
...@@ -163,7 +162,7 @@ void OpenDataBase(string file) ...@@ -163,7 +162,7 @@ void OpenDataBase(string file)
//设置语言 //设置语言
LANG.SetFormLabel(def); LANG.SetFormLabel(def);
//初始化界面数据 //初始化界面数据
def.InitGameData(datacfg); def.InitControl(datacfg);
def.Show(dockPanel1, DockState.Document); def.Show(dockPanel1, DockState.Document);
} }
//打开文件 //打开文件
...@@ -463,21 +462,6 @@ void CompareDB() ...@@ -463,21 +462,6 @@ void CompareDB()
#endregion #endregion
#region 获取函数列表
void Menuitem_findluafuncClick(object sender, EventArgs e)
{
using (FolderBrowserDialog fd = new FolderBrowserDialog())
{
fd.Description = "Folder Name: ocgcore";
if (fd.ShowDialog() == DialogResult.OK)
{
LuaFunction.Read(funtxt);//先读取旧函数列表
LuaFunction.Find(fd.SelectedPath);//查找新函数,并保存
MessageBox.Show("OK");
}
}
}
#endregion
#region 自动更新 #region 自动更新
private void bgWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) private void bgWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.9.2")] [assembly: AssemblyVersion("2.2.9.4")]
...@@ -43,6 +43,7 @@ DataEditForm.mainMenu.menu_setting 设置(&S) ...@@ -43,6 +43,7 @@ DataEditForm.mainMenu.menu_setting 设置(&S)
DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库 DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库
DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件 DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件
DataEditForm.mainMenu.menu_tools 工具(&T) DataEditForm.mainMenu.menu_tools 工具(&T)
DataEditForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y) DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y)
DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I) DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I)
DataEditForm.mainMenu.menuitem_compdb 压缩数据库 DataEditForm.mainMenu.menuitem_compdb 压缩数据库
...@@ -62,7 +63,6 @@ MainForm.mainMenu.menuitem_file 文件(&F) ...@@ -62,7 +63,6 @@ MainForm.mainMenu.menuitem_file 文件(&F)
MainForm.mainMenu.menuitem_open 打开 MainForm.mainMenu.menuitem_open 打开
MainForm.mainMenu.menuitem_new 新建 MainForm.mainMenu.menuitem_new 新建
MainForm.mainMenu.menuitem_save 保存 MainForm.mainMenu.menuitem_save 保存
MainForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
MainForm.mainMenu.menuitem_copyselect 复制选中卡片 MainForm.mainMenu.menuitem_copyselect 复制选中卡片
MainForm.mainMenu.menuitem_copyall 复制所有卡片 MainForm.mainMenu.menuitem_copyall 复制所有卡片
MainForm.mainMenu.menuitem_pastecards 粘贴卡片 MainForm.mainMenu.menuitem_pastecards 粘贴卡片
......
...@@ -15,6 +15,7 @@ spell = [魔法卡%%] ...@@ -15,6 +15,7 @@ spell = [魔法卡%%]
trap = [陷阱卡%%] trap = [陷阱卡%%]
############################ language,style,other setting ############################ 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
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################ ############################
......
...@@ -15,6 +15,7 @@ spell = [魔法卡%%] ...@@ -15,6 +15,7 @@ spell = [魔法卡%%]
trap = [陷阱卡%%] trap = [陷阱卡%%]
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: TW\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: TW\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n
############################ ############################
......
...@@ -12,6 +12,7 @@ spell = [Sepll Card%%] ...@@ -12,6 +12,7 @@ spell = [Sepll Card%%]
trap = [Trap Card%%] trap = [Trap Card%%]
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: EN\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: EN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n
############################ ############################
......
...@@ -13,6 +13,7 @@ spell = %% ...@@ -13,6 +13,7 @@ spell = %%
trap = %% trap = %%
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: JP\r\n\tedition: \r\n\tST mark is text: yes\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: JP\r\n\tedition: \r\n\tST mark is text: yes\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################ ############################
...@@ -31,7 +32,7 @@ replace = ([·]) ・ ...@@ -31,7 +32,7 @@ replace = ([·]) ・
########################### ###########################
##race ##race
race 0x1 戦士族 race 0x1 戦士族
race 0x2 魔法 race 0x2 魔法使い
race 0x4 天使族 race 0x4 天使族
race 0x8 悪魔族 race 0x8 悪魔族
race 0x10 アンデット族 race 0x10 アンデット族
......
[DataEditorX]2.2.9.2[DataEditorX] [DataEditorX]2.2.9.4[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联(File association) ★文件关联(File association)
...@@ -80,6 +80,11 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -80,6 +80,11 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.9.4
DataEditor
修改游戏数据的查找方式()Dic = >sortlist,加快卡片显示速度
2.2.9.3
修复CodeEditor
2.2.9.2 2.2.9.2
读取MSE存档暂未实现 读取MSE存档暂未实现
修改DataEditor界面 修改DataEditor界面
......
No preview for this file type
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<!-- access these values via the property: <!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key] System.Configuration.ConfigurationManager.AppSettings[key]
--> -->
<!-- MSE language --> <!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="mse_chs.txt" /> <add key="mse" value="Chinese-Simplified" />
<!-- Language --> <!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
<add key="language" value="chinese" /> <add key="language" value="chinese" />
<!-- DataEditorX source code --> <!-- DataEditorX source code -->
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
......
...@@ -2,4 +2,11 @@ ...@@ -2,4 +2,11 @@
F:\games\ygopro\cards.cdb F:\games\ygopro\cards.cdb
F:\games\ygopro\p.zip.cdb F:\games\ygopro\p.zip.cdb
# script history # script history
F:\games\ygopro\script\c259314.lua
F:\games\ygopro\script\c359563.lua
F:\games\ygopro\script\c218704.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 F:\games\ygopro\script\c41777.lua
\ No newline at end of file
...@@ -43,6 +43,7 @@ DataEditForm.mainMenu.menu_setting 设置(&S) ...@@ -43,6 +43,7 @@ DataEditForm.mainMenu.menu_setting 设置(&S)
DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库 DataEditForm.mainMenu.menuitem_importmseimg 设置为MSE图片库
DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件 DataEditForm.mainMenu.menuitem_mseconfig 设置MSE的配置文件
DataEditForm.mainMenu.menu_tools 工具(&T) DataEditForm.mainMenu.menu_tools 工具(&T)
DataEditForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y) DataEditForm.mainMenu.menuitem_readydk 从卡组文件读取卡片(&Y)
DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I) DataEditForm.mainMenu.menuitem_readimages 从卡图文件夹读取卡片(&I)
DataEditForm.mainMenu.menuitem_compdb 压缩数据库 DataEditForm.mainMenu.menuitem_compdb 压缩数据库
...@@ -62,7 +63,6 @@ MainForm.mainMenu.menuitem_file 文件(&F) ...@@ -62,7 +63,6 @@ MainForm.mainMenu.menuitem_file 文件(&F)
MainForm.mainMenu.menuitem_open 打开 MainForm.mainMenu.menuitem_open 打开
MainForm.mainMenu.menuitem_new 新建 MainForm.mainMenu.menuitem_new 新建
MainForm.mainMenu.menuitem_save 保存 MainForm.mainMenu.menuitem_save 保存
MainForm.mainMenu.menuitem_findluafunc 从C++源码查找Lua函数
MainForm.mainMenu.menuitem_copyselect 复制选中卡片 MainForm.mainMenu.menuitem_copyselect 复制选中卡片
MainForm.mainMenu.menuitem_copyall 复制所有卡片 MainForm.mainMenu.menuitem_copyall 复制所有卡片
MainForm.mainMenu.menuitem_pastecards 粘贴卡片 MainForm.mainMenu.menuitem_pastecards 粘贴卡片
......
...@@ -15,6 +15,7 @@ spell = [魔法卡%%] ...@@ -15,6 +15,7 @@ spell = [魔法卡%%]
trap = [陷阱卡%%] trap = [陷阱卡%%]
############################ language,style,other setting ############################ 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
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################ ############################
......
...@@ -15,6 +15,7 @@ spell = [魔法卡%%] ...@@ -15,6 +15,7 @@ spell = [魔法卡%%]
trap = [陷阱卡%%] trap = [陷阱卡%%]
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: TW\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: TW\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n
############################ ############################
......
...@@ -12,6 +12,7 @@ spell = [Sepll Card%%] ...@@ -12,6 +12,7 @@ spell = [Sepll Card%%]
trap = [Trap Card%%] trap = [Trap Card%%]
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: EN\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: EN\r\n\tedition: \r\n\tST mark is text: no\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n
############################ ############################
......
...@@ -13,6 +13,7 @@ spell = %% ...@@ -13,6 +13,7 @@ spell = %%
trap = %% trap = %%
############################ language,style,other setting ############################ language,style,other setting
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: JP\r\n\tedition: \r\n\tST mark is text: yes\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: JP\r\n\tedition: \r\n\tST mark is text: yes\r\n\tpendulum image is small: yes
end = version control:\n\ttype: none\napprentice code:
############################ Text ############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################ ############################
...@@ -31,7 +32,7 @@ replace = ([·]) ・ ...@@ -31,7 +32,7 @@ replace = ([·]) ・
########################### ###########################
##race ##race
race 0x1 戦士族 race 0x1 戦士族
race 0x2 魔法 race 0x2 魔法使い
race 0x4 天使族 race 0x4 天使族
race 0x8 悪魔族 race 0x8 悪魔族
race 0x10 アンデット族 race 0x10 アンデット族
......
[DataEditorX]2.2.9.2[DataEditorX] [DataEditorX]2.2.9.4[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联(File association) ★文件关联(File association)
...@@ -80,6 +80,11 @@ Ctrl+鼠标左键 跳转到函数定义 ...@@ -80,6 +80,11 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字 Ctrl+鼠标滑轮 缩放文字
★更新历史 ★更新历史
2.2.9.4
DataEditor
修改游戏数据的查找方式()Dic = >sortlist,加快卡片显示速度
2.2.9.3
修复CodeEditor
2.2.9.2 2.2.9.2
读取MSE存档暂未实现 读取MSE存档暂未实现
修改DataEditor界面 修改DataEditor界面
......
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