Commit 928a6ceb authored by keyongyu's avatar keyongyu

1.5.5.2

parent 57be0d95
Images/ Images/
*.tmp
################# #################
## Eclipse ## Eclipse
################# #################
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.IO.Compression; using System.IO.Compression;
using System.Windows.Forms;
namespace DataEditorX.Core namespace DataEditorX.Core
{ {
...@@ -51,7 +52,8 @@ public class MSE ...@@ -51,7 +52,8 @@ public class MSE
} }
public static void Save(string file, Card[] cards,string pic){ public static void Save(string file, Card[] cards,string pic){
string setFile=file+".txt";
string setFile=Path.Combine(Application.StartupPath, "set.tmp");
string[] images=WriteSet(setFile, cards, pic); string[] images=WriteSet(setFile, cards, pic);
using(ZipStorer zips=ZipStorer.Create(file, "")) using(ZipStorer zips=ZipStorer.Create(file, ""))
{ {
...@@ -81,7 +83,7 @@ public static string[] WriteSet(string file,Card[] cards,string pic) ...@@ -81,7 +83,7 @@ public static string[] WriteSet(string file,Card[] cards,string pic)
} }
else else
jpg=""; jpg="";
if(c.IsType(CardType.TYPE_SPELL)) if(c.IsType(CardType.TYPE_SPELL))
sw.WriteLine(getSpell(c, jpg)); sw.WriteLine(getSpell(c, jpg));
else if(c.IsType(CardType.TYPE_TRAP)) else if(c.IsType(CardType.TYPE_TRAP))
...@@ -96,13 +98,24 @@ public static string[] WriteSet(string file,Card[] cards,string pic) ...@@ -96,13 +98,24 @@ public static string[] WriteSet(string file,Card[] cards,string pic)
return list.ToArray(); return list.ToArray();
} }
public static string reItalic(string str)
{
foreach(string s in cfg.repalces)
{
if(!string.IsNullOrEmpty(s))
str=str.Replace(s,"<i>"+s+"</i>");
}
return str;
}
static string getMonster(Card c,string img) static string getMonster(Card c,string img)
{ {
StringBuilder sb=new StringBuilder(cfg.monster); StringBuilder sb=new StringBuilder(cfg.monster);
string[] types=MSEConvert.GetTypes(c); string[] types=MSEConvert.GetTypes(c);
string race=MSEConvert.GetRace(c.race); string race=MSEConvert.GetRace(c.race);
sb.Replace("%type%", types[0]); sb.Replace("%type%", types[0]);
sb.Replace("%name%", c.name); sb.Replace("%name%", MSE.reItalic(c.name));
sb.Replace("%attribute%", MSEConvert.GetAttribute(c.attribute)); sb.Replace("%attribute%", MSEConvert.GetAttribute(c.attribute));
sb.Replace("%level%", MSEConvert.GetStar(c.level)); sb.Replace("%level%", MSEConvert.GetStar(c.level));
sb.Replace("%image%", img); sb.Replace("%image%", img);
...@@ -125,7 +138,7 @@ static string getPendulum(Card c,string img) ...@@ -125,7 +138,7 @@ static string getPendulum(Card c,string img)
string[] types=MSEConvert.GetTypes(c); string[] types=MSEConvert.GetTypes(c);
string race=MSEConvert.GetRace(c.race); string race=MSEConvert.GetRace(c.race);
sb.Replace("%type%", types[0]); sb.Replace("%type%", types[0]);
sb.Replace("%name%", c.name); sb.Replace("%name%", MSE.reItalic(c.name));
sb.Replace("%attribute%", MSEConvert.GetAttribute(c.attribute)); sb.Replace("%attribute%", MSEConvert.GetAttribute(c.attribute));
sb.Replace("%level%", MSEConvert.GetStar(c.level)); sb.Replace("%level%", MSEConvert.GetStar(c.level));
sb.Replace("%image%", img); sb.Replace("%image%", img);
...@@ -164,7 +177,7 @@ static string getSpell(Card c,string img) ...@@ -164,7 +177,7 @@ static string getSpell(Card c,string img)
level="^"; level="^";
StringBuilder sb=new StringBuilder(cfg.spelltrap); StringBuilder sb=new StringBuilder(cfg.spelltrap);
sb.Replace("%type%", "spell card"); sb.Replace("%type%", "spell card");
sb.Replace("%name%", c.name); sb.Replace("%name%", MSE.reItalic(c.name));
sb.Replace("%attribute%", "spell"); sb.Replace("%attribute%", "spell");
sb.Replace("%level%", level); sb.Replace("%level%", level);
sb.Replace("%image%", img); sb.Replace("%image%", img);
...@@ -183,7 +196,7 @@ static string getTrap(Card c,string img) ...@@ -183,7 +196,7 @@ static string getTrap(Card c,string img)
level="^"; level="^";
StringBuilder sb=new StringBuilder(cfg.spelltrap); StringBuilder sb=new StringBuilder(cfg.spelltrap);
sb.Replace("%type%", "trap card"); sb.Replace("%type%", "trap card");
sb.Replace("%name%", c.name); sb.Replace("%name%", MSE.reItalic(c.name));
sb.Replace("%attribute%", "trap"); sb.Replace("%attribute%", "trap");
sb.Replace("%level%", level); sb.Replace("%level%", level);
sb.Replace("%image%", img); sb.Replace("%image%", img);
......
...@@ -34,12 +34,20 @@ public MSEConfig(string path) ...@@ -34,12 +34,20 @@ public MSEConfig(string path)
monster = read(path, "mse-monster.txt"); monster = read(path, "mse-monster.txt");
pendulum = read(path, "mse-pendulum.txt"); pendulum = read(path, "mse-pendulum.txt");
spelltrap = read(path, "mse-spelltrap.txt"); spelltrap = read(path, "mse-spelltrap.txt");
string tmp=Path.Combine(path, "mse-italic.txt");
if(File.Exists(tmp))
repalces = File.ReadAllLines(tmp);
else
repalces = new String[1];
} }
string read(string path,string name) string read(string path,string name)
{ {
string tmp=Path.Combine(path, name); string tmp=Path.Combine(path, name);
return File.Exists(tmp)?File.ReadAllText(tmp):""; return File.Exists(tmp)?File.ReadAllText(tmp):"";
} }
public string[] repalces;
public string regx_pendulum; public string regx_pendulum;
public string regx_monster; public string regx_monster;
public string head; public string head;
......
...@@ -27,7 +27,7 @@ public class MSEConvert ...@@ -27,7 +27,7 @@ public class MSEConvert
} }
public static string ReDesc(string desc) public static string ReDesc(string desc)
{ {
StringBuilder sb=new StringBuilder(desc); StringBuilder sb=new StringBuilder(MSE.reItalic(desc));
sb.Replace(Environment.NewLine, "\n"); sb.Replace(Environment.NewLine, "\n");
sb.Replace("\n\n","\n"); sb.Replace("\n\n","\n");
sb.Replace("\n","\n\t\t"); sb.Replace("\n","\n\t\t");
......
...@@ -127,6 +127,9 @@ ...@@ -127,6 +127,9 @@
<None Include="chinese\message.txt"> <None Include="chinese\message.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="chinese\mse-italic.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="chinese\mse-monster.txt"> <None Include="chinese\mse-monster.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
...@@ -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("1.5.5.1")] [assembly: AssemblyVersion("1.5.5.2")]
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
<add key="image_pendulum" value="14,46,149,120" /> <add key="image_pendulum" value="14,46,149,120" />
<!-- MSE --> <!-- MSE -->
<add key="mse-pendulum-text" value="】[\s\S]*?\n([\S\s]*?)\n【" /> <add key="mse-pendulum-text" value="】[\s\S]*?\n([\S\s]*?)\n【" />
<add key="mse-monster-text" value="[果|介]】\n([\S\s]*)" /> <add key="mse-monster-text" value="[果|介|述]】\n([\S\s]*)" />
</appSettings> </appSettings>
</configuration> </configuration>
\ No newline at end of file
\
鮟鱇
\ No newline at end of file
[DataEditorX]1.5.5.1[DataEditorX] [DataEditorX]1.5.5.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。 ★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...@@ -47,6 +47,8 @@ DataEditorX.exe.config ...@@ -47,6 +47,8 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1 1.5.5.1
修复第2次导入图片,出bug 修复第2次导入图片,出bug
1.5.5.0 1.5.5.0
......
No preview for this file type
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
<add key="image_pendulum" value="14,46,149,120" /> <add key="image_pendulum" value="14,46,149,120" />
<!-- MSE --> <!-- MSE -->
<add key="mse-pendulum-text" value="】[\s\S]*?\n([\S\s]*?)\n【" /> <add key="mse-pendulum-text" value="】[\s\S]*?\n([\S\s]*?)\n【" />
<add key="mse-monster-text" value="[果|介]】\n([\S\s]*)" /> <add key="mse-monster-text" value="[果|介|述]】\n([\S\s]*)" />
</appSettings> </appSettings>
</configuration> </configuration>
\ No newline at end of file
\
鮟鱇
\ No newline at end of file
[DataEditorX]1.5.5.1[DataEditorX] [DataEditorX]1.5.5.2[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。 ★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...@@ -47,6 +47,8 @@ DataEditorX.exe.config ...@@ -47,6 +47,8 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1 1.5.5.1
修复第2次导入图片,出bug 修复第2次导入图片,出bug
1.5.5.0 1.5.5.0
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment