Commit aa4ae85f authored by keyongyu's avatar keyongyu

2.2.9.1

parent 98040680
......@@ -25,11 +25,13 @@ static CheckUpdate()
public static string URL = "";
static string HEAD = "[DataEditorX]", HEAD2 = "[URL]";
public static bool isOK = false;
public const string DEFALUT = "0.0.0.0";
public const int VER_LENGTH = 4;
#region 检查版本
public static string Check(string VERURL)
public static string GetNewVersion(string VERURL)
{
string urlver = "0.0.0.0";
string urlver = DEFALUT;
string html = GetHtmlContentByUrl(VERURL);
if (!string.IsNullOrEmpty(html))
{
......@@ -38,17 +40,45 @@ public static string Check(string VERURL)
w = (t > 0) ? html.IndexOf(HEAD, t + HEAD.Length) : 0;
if (w > 0)
{
//获取版本
urlver = html.Substring(t + HEAD.Length, w - t - HEAD.Length);
}
t = html.IndexOf(HEAD2);
w = (t > 0) ? html.IndexOf(HEAD2, t + HEAD2.Length) : 0;
if (w > 0)
{
//获取下载地址
URL = html.Substring(t + HEAD2.Length, w - t - HEAD2.Length);
}
}
return urlver;
}
//检查版本号,格式0.0.0.0
public static bool CheckVersion(string ver, string oldver)
{
bool hasNew = false;
string[] vers = ver.Split('.');
string[] oldvers = oldver.Split('.');
if (vers.Length == oldvers.Length && vers.Length == VER_LENGTH)
{
int j, k;
for (int i = 0; i < VER_LENGTH; i++)
{
int.TryParse(vers[i], out j);
int.TryParse(oldvers[i], out k);
if (j > k)
{
hasNew = true;
break;
}
}
}
#if DEBUG
MessageBox.Show("new:" + ver + ",oldver:" + oldver + ",hasnew:" + hasNew.ToString());
#endif
return hasNew;
}
#endregion
#region 获取网址内容
......
......@@ -122,9 +122,7 @@ public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality)
}
return false;
}
#endregion
#endregion
}
}
......
......@@ -35,7 +35,12 @@ public static string getMultLineValue(string line)
}
public static string getRegex(string word)
{
return word.Replace("\\n", Environment.NewLine).Replace("\\t", "\t").Replace("\\s", " ");
StringBuilder sb = new StringBuilder(word);
sb.Replace("\\r", "\r");
sb.Replace("\\n", "\n");
sb.Replace("\\t", "\t");
sb.Replace("[:space:]", " ");
return sb.ToString();
}
public static bool getBooleanValue(string line)
{
......
......@@ -38,6 +38,7 @@ public History(IMainForm mainForm)
cdbhistory = new List<string>();
luahistory = new List<string>();
}
//读取历史记录
public void ReadHistory(string historyFile)
{
this.historyFile = historyFile;
......@@ -46,6 +47,7 @@ public void ReadHistory(string historyFile)
string[] lines = File.ReadAllLines(historyFile);
AddHistorys(lines);
}
//添加历史记录
void AddHistorys(string[] lines)
{
luahistory.Clear();
......@@ -84,6 +86,7 @@ public void AddHistory(string file)
SaveHistory();
MenuHistory();
}
//保存历史
void SaveHistory()
{
string texts = "# database history";
......@@ -102,6 +105,7 @@ void SaveHistory()
File.Delete(historyFile);
File.WriteAllText(historyFile, texts);
}
//添加历史记录菜单
public void MenuHistory()
{
//cdb历史
......@@ -129,6 +133,7 @@ public void MenuHistory()
tsmiclear2.Click += MenuHistoryClear2_Click;
mainForm.AddLuaMenu(tsmiclear2);
}
void MenuHistoryClear2_Click(object sender, EventArgs e)
{
luahistory.Clear();
......
......@@ -6,11 +6,17 @@ namespace DataEditorX.Controls
{
interface IEditForm
{
//获取打开的文件路径
string GetOpenFile();
//创建文件
bool Create(string file);
//打开文件
bool Open(string file);
//是否能打开某个文件
bool CanOpen(string file);
//保存
bool Save();
//设置为活动窗口
void SetActived();
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
namespace DataEditorX.Core
{
public class MseReader
{
public const string TAG_CARDTYPE = "card type";
public const string TAG_NAME = "name";
public const string TAG_ATTRIBUTE = "attribute";
public const string TAG_LEVEL = "level";
public const string TAG_IMAGE = "image";
public const string TAG_TYPE1 = "type 1";
public const string TAG_TYPE2 = "type 2";
public const string TAG_TYPE3 = "type 3";
public const string TAG_TYPE4 = "type 4";
public const string TAG_TEXT = "rule text";
public const string TAG_ATK = "attack";
public const string TAG_DEF = "defense";
public const string TAG_PSCALE1 = "pendulum scale 1";
public const string TAG_PSCALE2 = "pendulum scale 2";
public const string TAG_PEND_TEXT = "pendulum text";
public const string TAG_CODE = "gamecode";
}
}
......@@ -96,29 +96,28 @@ public void ToImg(string img, string saveimg1, string saveimg2)
#region 检查更新
public static void CheckVersion(bool showNew)
{
string newver = CheckUpdate.Check(MyConfig.readString(MyConfig.TAG_UPDATE_URL));
int iver, iver2;
int.TryParse(Application.ProductVersion.Replace(".", ""), out iver);
int.TryParse(newver.Replace(".", ""), out iver2);
if (iver2 > iver)
string newver = CheckUpdate.GetNewVersion(MyConfig.readString(MyConfig.TAG_UPDATE_URL));
if (newver == CheckUpdate.DEFALUT)
{ //检查失败
if (!showNew)
return;
MyMsg.Error(LMSG.CheckUpdateFail);
return;
}
if (CheckUpdate.CheckVersion(newver, Application.ProductVersion))
{//有最新版本
if (!MyMsg.Question(LMSG.HaveNewVersion))
return;
}
else if (iver2 > 0)
else
{//现在就是最新版本
if (!showNew)
return;
if (!MyMsg.Question(LMSG.NowIsNewVersion))
return;
}
else
{//检查失败
if (!showNew)
return;
MyMsg.Error(LMSG.CheckUpdateFail);
return;
}
//下载文件
if (CheckUpdate.DownLoad(
MyPath.Combine(Application.StartupPath, newver + ".zip")))
MyMsg.Show(LMSG.DownloadSucceed);
......
......@@ -706,9 +706,6 @@ public void Search(Card c, bool isfresh)
{
srcCard = c;
string sql = DataBase.GetSelectSQL(c);
#if DEBUG
MyMsg.Show(sql);
#endif
SetCards(DataBase.Read(nowCdbFile, true, sql), isfresh);
}
}
......
......@@ -96,7 +96,6 @@
<Compile Include="Core\LuaFunction.cs" />
<Compile Include="Core\MseMaker.cs" />
<Compile Include="Config\MSEConfig.cs" />
<Compile Include="Core\MseReader.cs" />
<Compile Include="Core\TaskHelper.cs" />
<Compile Include="Core\YGOUtil.cs" />
<Compile Include="DataEditForm.cs">
......
......@@ -17,9 +17,6 @@
namespace DataEditorX
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form, IMainForm
{
#region member
......
......@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.9.0")]
[assembly: AssemblyVersion("2.2.9.1")]
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: CN\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################
......@@ -26,8 +26,8 @@ pendulum-text = 】[\s\S]*?\n([\S\s]*?)\n【
monster-text = [果|介|述|報]】\n([\S\s]*)
# en monster-text = Text:[\s\S]*?Text:\n([\S\s]*)
########################### Replace
replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
replace = ([鮟|鱇]) <i>$1</i>
#replace = [:space:] <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
##race
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: TW\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n
############################
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -11,7 +11,7 @@ imagepath = ./Images
spell = [Sepll Card%%]
trap = [Trap Card%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: EN\n\tedition: \n\tST mark is text: no\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
############################ Text
text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n
############################
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -12,7 +12,7 @@ imagepath = ./Images
spell = %%
trap = %%
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: JP\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################
......
[DataEditorX]2.2.9.0[DataEditorX]
[DataEditorX]2.2.9.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联(File association)
......@@ -14,13 +14,11 @@ Email:247321453@qq.com
错误提示文字:(弹出出错框,请按Ctrl+C,然后找地方粘贴)
详细描述:(卡片信息,杀毒软件,本程序目录等等)
Title:(DataEditorX+Version)
Content:Error Message
★支持多语言化(Language setting)
DataEditorX.exe.config
<add key="language" value="chinese" />简体
<add key="language" value="english" />英文
其他语言请自己添加
★DataEditor:
攻击力为?,可以输入?,?,-2任意一个都可以。
......@@ -51,11 +49,30 @@ DataEditorX.exe.config
https://github.com/247321453/MagicSetEditor2
★MSE存档生成设置
mse-head MSE的风格设置文件
mse-monster 普通怪兽模版
mse-pendulum P怪兽模版
mse-spelltrap 魔陷模版
mse-config 设置pendulum文本和普通文本的正则正则表达式,用来分离文本,支持设置每个存档的最大卡片数量
在每个语言的mse_xxx.txt修改\r\n会替换为换行,\t会替换为tab
简体转繁体,
cn2tw = false
每个存档最大数,0则是无限
maxcount = 0
从下面的文件夹找图片添加到存档,名字为密码/卡名.png/jpg
imagepath = ./Images
魔法陷阱标志,%%替换为符号,如果只是%% ,需要设置下面的ST mark is text: yes
spell = [魔法卡%%]
trap = [陷阱卡%%]
游戏yugioh,风格standard,语言CN,Edition:MSE,P怪的中间图不包含P文本区域
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: MSE\r\n\tST mark is text: no\r\n\tpendulum image is small: yes
读取存档,卡片描述
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
获取P文本
pendulum-text = 】[\s\S]*?\n([\S\s]*?)\n【
获取怪兽文本
monster-text = [果|介|述|報]】\n([\S\s]*)
替换特数字
replace = ([鮟|鱇|・|·]) <i>$1</i>
把空格替换为^,(占1/3字宽)
#replace = \s <sym-auto>^</sym-auto>
把A-Z替换为另外一种字体
#replace = ([A-Z]) <i>$1</i>
★lua编辑器
在下面的文本框输入关键字,按Enter
......@@ -63,6 +80,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
2.2.9.1
添加MSE设置说明
2.2.9.0
可以切换MSE的配置
配置整合
......
No preview for this file type
# database history
F:\games\ygopro\cards.cdb
F:\games\ygopro\p.zip.cdb
# script history
F:\games\ygopro\script\c41777.lua
\ No newline at end of file
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: CN\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################
......@@ -26,8 +26,8 @@ pendulum-text = 】[\s\S]*?\n([\S\s]*?)\n【
monster-text = [果|介|述|報]】\n([\S\s]*)
# en monster-text = Text:[\s\S]*?Text:\n([\S\s]*)
########################### Replace
replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
replace = ([鮟|鱇]) <i>$1</i>
#replace = [:space:] <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
###########################
##race
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -14,7 +14,7 @@ imagepath = ./Images
spell = [魔法卡%%]
trap = [陷阱卡%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: TW\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪獸效果】\n%text%\n
############################
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -11,7 +11,7 @@ imagepath = ./Images
spell = [Sepll Card%%]
trap = [Trap Card%%]
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: EN\n\tedition: \n\tST mark is text: no\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
############################ Text
text = Pendulum Text :\n%ptext%\nMonster Text :\n%text%\n
############################
......
###########################
# Magic Set Editor 2
#
# \t = Tab \n = Enter \s = Space
# \t = Tab \n = Enter [:space:] = Space
########################### Chs 2 Cht
cn2tw = false
########################### Setting
......@@ -12,7 +12,7 @@ imagepath = ./Images
spell = %%
trap = %%
############################ language,style,other setting
head = mse version: 0.3.8\ngame: yugioh\nstylesheet: standard\nset info:\n\tlanguage: JP\n\tedition: \n\tST mark is text: no\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
############################ Text
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
############################
......
[DataEditorX]2.2.9.0[DataEditorX]
[DataEditorX]2.2.9.1[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★文件关联(File association)
......@@ -14,13 +14,11 @@ Email:247321453@qq.com
错误提示文字:(弹出出错框,请按Ctrl+C,然后找地方粘贴)
详细描述:(卡片信息,杀毒软件,本程序目录等等)
Title:(DataEditorX+Version)
Content:Error Message
★支持多语言化(Language setting)
DataEditorX.exe.config
<add key="language" value="chinese" />简体
<add key="language" value="english" />英文
其他语言请自己添加
★DataEditor:
攻击力为?,可以输入?,?,-2任意一个都可以。
......@@ -51,11 +49,30 @@ DataEditorX.exe.config
https://github.com/247321453/MagicSetEditor2
★MSE存档生成设置
mse-head MSE的风格设置文件
mse-monster 普通怪兽模版
mse-pendulum P怪兽模版
mse-spelltrap 魔陷模版
mse-config 设置pendulum文本和普通文本的正则正则表达式,用来分离文本,支持设置每个存档的最大卡片数量
在每个语言的mse_xxx.txt修改\r\n会替换为换行,\t会替换为tab
简体转繁体,
cn2tw = false
每个存档最大数,0则是无限
maxcount = 0
从下面的文件夹找图片添加到存档,名字为密码/卡名.png/jpg
imagepath = ./Images
魔法陷阱标志,%%替换为符号,如果只是%% ,需要设置下面的ST mark is text: yes
spell = [魔法卡%%]
trap = [陷阱卡%%]
游戏yugioh,风格standard,语言CN,Edition:MSE,P怪的中间图不包含P文本区域
head = mse version: 0.3.8\r\ngame: yugioh\r\nstylesheet: standard\r\nset info:\r\n\tlanguage: CN\r\n\tedition: MSE\r\n\tST mark is text: no\r\n\tpendulum image is small: yes
读取存档,卡片描述
text =【摇摆效果】\n%ptext%\n【怪兽效果】\n%text%\n
获取P文本
pendulum-text = 】[\s\S]*?\n([\S\s]*?)\n【
获取怪兽文本
monster-text = [果|介|述|報]】\n([\S\s]*)
替换特数字
replace = ([鮟|鱇|・|·]) <i>$1</i>
把空格替换为^,(占1/3字宽)
#replace = \s <sym-auto>^</sym-auto>
把A-Z替换为另外一种字体
#replace = ([A-Z]) <i>$1</i>
★lua编辑器
在下面的文本框输入关键字,按Enter
......@@ -63,6 +80,8 @@ Ctrl+鼠标左键 跳转到函数定义
Ctrl+鼠标滑轮 缩放文字
★更新历史
2.2.9.1
添加MSE设置说明
2.2.9.0
可以切换MSE的配置
配置整合
......
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