Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
DataEditorX
Commits
02392a2d
Commit
02392a2d
authored
Oct 15, 2014
by
keyongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.6.0.0
parent
928a6ceb
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
115 additions
and
96 deletions
+115
-96
DataEditorX/Core/MSE.cs
DataEditorX/Core/MSE.cs
+31
-80
DataEditorX/Core/MSEConvert.cs
DataEditorX/Core/MSEConvert.cs
+41
-2
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+3
-3
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+1
-0
DataEditorX/Properties/AssemblyInfo.cs
DataEditorX/Properties/AssemblyInfo.cs
+1
-1
DataEditorX/app.config
DataEditorX/app.config
+2
-1
DataEditorX/chinese/mse-head.txt
DataEditorX/chinese/mse-head.txt
+1
-1
DataEditorX/chinese/mse-italic.txt
DataEditorX/chinese/mse-italic.txt
+3
-2
DataEditorX/readme.txt
DataEditorX/readme.txt
+13
-1
win32/DataEditorX.exe
win32/DataEditorX.exe
+0
-0
win32/DataEditorX.exe.config
win32/DataEditorX.exe.config
+2
-1
win32/chinese/mse-head.txt
win32/chinese/mse-head.txt
+1
-1
win32/chinese/mse-italic.txt
win32/chinese/mse-italic.txt
+3
-2
win32/readme.txt
win32/readme.txt
+13
-1
win32/win32.zip
win32/win32.zip
+0
-0
No files found.
DataEditorX/Core/MSE.cs
View file @
02392a2d
...
...
@@ -10,6 +10,7 @@
using
System.Configuration
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.IO.Compression
;
using
System.Windows.Forms
;
...
...
@@ -49,11 +50,14 @@ public class MSE
mTypedic
=
typedic
;
mRacedic
=
racedic
;
MSEConvert
.
Init
(
typedic
,
racedic
);
isInit
=
true
;
}
public
static
void
Save
(
string
file
,
Card
[]
cards
,
string
pic
){
if
(!
isInit
)
return
;
string
setFile
=
Path
.
Combine
(
Application
.
StartupPath
,
"
set.tmp
"
);
string
setFile
=
Path
.
Combine
(
Application
.
StartupPath
,
"
mse-set.txt
"
);
string
[]
images
=
WriteSet
(
setFile
,
cards
,
pic
);
using
(
ZipStorer
zips
=
ZipStorer
.
Create
(
file
,
""
))
{
...
...
@@ -64,7 +68,6 @@ public class MSE
}
zips
.
Close
();
}
File
.
Delete
(
setFile
);
}
public
static
string
[]
WriteSet
(
string
file
,
Card
[]
cards
,
string
pic
)
{
...
...
@@ -83,35 +86,34 @@ public static string[] WriteSet(string file,Card[] cards,string pic)
}
else
jpg
=
""
;
if
(
c
.
IsType
(
CardType
.
TYPE_SPELL
))
sw
.
WriteLine
(
getSpell
(
c
,
jpg
));
else
if
(
c
.
IsType
(
CardType
.
TYPE_TRAP
))
sw
.
WriteLine
(
getTrap
(
c
,
jpg
));
else
if
(
c
.
IsType
(
CardType
.
TYPE_PENDULUM
))
sw
.
WriteLine
(
getPendulum
(
c
,
jpg
));
if
(
c
.
IsType
(
CardType
.
TYPE_SPELL
)||
c
.
IsType
(
CardType
.
TYPE_TRAP
))
sw
.
WriteLine
(
getSpellTrap
(
c
,
jpg
,
c
.
IsType
(
CardType
.
TYPE_SPELL
)));
else
sw
.
WriteLine
(
getMonster
(
c
,
jpg
));
sw
.
WriteLine
(
getMonster
(
c
,
jpg
,
c
.
IsType
(
CardType
.
TYPE_PENDULUM
)
));
}
sw
.
Close
();
}
return
list
.
ToArray
();
}
public
static
string
reItalic
(
string
str
)
{
str
=
MSEConvert
.
cn2tw
(
str
);
foreach
(
string
s
in
cfg
.
repalces
)
{
if
(!
string
.
IsNullOrEmpty
(
s
))
str
=
str
.
Replace
(
s
,
"<i>"
+
s
+
"
</i>"
);
if
(!
string
.
IsNullOrEmpty
(
s
)
&&
!
s
.
StartsWith
(
"#"
)
&&
s
.
Length
>
0
)
str
=
Regex
.
Replace
(
str
,
"("
+
s
+
")"
,
"<i>$1
</i>"
);
}
return
str
;
}
static
string
getMonster
(
Card
c
,
string
img
)
static
string
getMonster
(
Card
c
,
string
img
,
bool
isPendulum
)
{
StringBuilder
sb
=
new
StringBuilder
(
cfg
.
monster
);
StringBuilder
sb
=
new
StringBuilder
();
if
(
isPendulum
)
sb
.
Append
(
cfg
.
pendulum
);
else
sb
.
Append
(
cfg
.
monster
);
string
[]
types
=
MSEConvert
.
GetTypes
(
c
);
string
race
=
MSEConvert
.
GetRace
(
c
.
race
);
sb
.
Replace
(
"%type%"
,
types
[
0
]);
...
...
@@ -123,87 +125,36 @@ static string getMonster(Card c,string img)
sb
.
Replace
(
"%type1%"
,
types
[
1
]);
sb
.
Replace
(
"%type2%"
,
types
[
2
]);
sb
.
Replace
(
"%type3%"
,
types
[
3
]);
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
c
.
desc
));
if
(!
string
.
IsNullOrEmpty
(
race
))
{
sb
.
Replace
(
"%atk%"
,
(
c
.
atk
<
0
)?
"?"
:
c
.
atk
.
ToString
());
sb
.
Replace
(
"%def%"
,
(
c
.
def
<
0
)?
"?"
:
c
.
def
.
ToString
());
if
(
isPendulum
){
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
MSEConvert
.
GetDesc
(
c
.
desc
,
cfg
.
regx_monster
)));
sb
.
Replace
(
"%pl%"
,
((
c
.
level
>>
0x18
)
&
0xff
).
ToString
());
sb
.
Replace
(
"%pr%"
,
((
c
.
level
>>
0x10
)
&
0xff
).
ToString
());
sb
.
Replace
(
"%pdesc%"
,
MSEConvert
.
ReDesc
(
MSEConvert
.
GetDesc
(
c
.
desc
,
cfg
.
regx_pendulum
)));
}
sb
.
Replace
(
"%code%"
,
c
.
id
.
ToString
(
"00000000"
));
return
sb
.
ToString
();
}
static
string
getPendulum
(
Card
c
,
string
img
)
{
StringBuilder
sb
=
new
StringBuilder
(
cfg
.
pendulum
);
string
[]
types
=
MSEConvert
.
GetTypes
(
c
);
string
race
=
MSEConvert
.
GetRace
(
c
.
race
);
sb
.
Replace
(
"%type%"
,
types
[
0
]);
sb
.
Replace
(
"%name%"
,
MSE
.
reItalic
(
c
.
name
));
sb
.
Replace
(
"%attribute%"
,
MSEConvert
.
GetAttribute
(
c
.
attribute
));
sb
.
Replace
(
"%level%"
,
MSEConvert
.
GetStar
(
c
.
level
));
sb
.
Replace
(
"%image%"
,
img
);
sb
.
Replace
(
"%race%"
,
race
);
sb
.
Replace
(
"%type1%"
,
types
[
1
]);
sb
.
Replace
(
"%type2%"
,
types
[
2
]);
sb
.
Replace
(
"%type3%"
,
types
[
3
]);
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
MSEConvert
.
GetDesc
(
c
.
desc
,
cfg
.
regx_monster
)));
else
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
MSEConvert
.
GetDesc
(
c
.
desc
,
cfg
.
regx_monster
)));
if
(!
string
.
IsNullOrEmpty
(
race
))
{
sb
.
Replace
(
"%atk%"
,
(
c
.
atk
<
0
)?
"?"
:
c
.
atk
.
ToString
());
sb
.
Replace
(
"%def%"
,
(
c
.
def
<
0
)?
"?"
:
c
.
def
.
ToString
());
}
sb
.
Replace
(
"%code%"
,
c
.
id
.
ToString
(
"00000000"
));
sb
.
Replace
(
"%pl%"
,
((
c
.
level
>>
0x18
)
&
0xff
).
ToString
());
sb
.
Replace
(
"%pr%"
,
((
c
.
level
>>
0x10
)
&
0xff
).
ToString
());
sb
.
Replace
(
"%pdesc%"
,
MSEConvert
.
ReDesc
(
MSEConvert
.
GetDesc
(
c
.
desc
,
cfg
.
regx_pendulum
)));
return
sb
.
ToString
();
}
static
string
getSpell
(
Card
c
,
string
img
)
{
string
level
=
""
;
if
(
c
.
IsType
(
CardType
.
TYPE_EQUIP
))
level
=
"+"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_QUICKPLAY
))
level
=
"$"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_FIELD
))
level
=
"&"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_CONTINUOUS
))
level
=
"%"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_RITUAL
))
level
=
"#"
;
else
level
=
"^"
;
StringBuilder
sb
=
new
StringBuilder
(
cfg
.
spelltrap
);
sb
.
Replace
(
"%type%"
,
"spell card"
);
sb
.
Replace
(
"%name%"
,
MSE
.
reItalic
(
c
.
name
));
sb
.
Replace
(
"%attribute%"
,
"spell"
);
sb
.
Replace
(
"%level%"
,
level
);
sb
.
Replace
(
"%image%"
,
img
);
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
c
.
desc
));
sb
.
Replace
(
"%code%"
,
c
.
id
.
ToString
(
"00000000"
));
return
sb
.
ToString
();
}
static
string
get
Trap
(
Card
c
,
string
img
)
static
string
get
SpellTrap
(
Card
c
,
string
img
,
bool
isSpell
)
{
string
level
=
""
;
if
(
c
.
IsType
(
CardType
.
TYPE_COUNTER
))
level
=
"!"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_CONTINUOUS
))
level
=
"%"
;
else
level
=
"^"
;
StringBuilder
sb
=
new
StringBuilder
(
cfg
.
spelltrap
);
sb
.
Replace
(
"%type%"
,
"trap card"
);
sb
.
Replace
(
"%type%"
,
isSpell
?
"spell card"
:
"trap card"
);
sb
.
Replace
(
"%name%"
,
MSE
.
reItalic
(
c
.
name
));
sb
.
Replace
(
"%attribute%"
,
"trap"
);
sb
.
Replace
(
"%level%"
,
level
);
sb
.
Replace
(
"%attribute%"
,
isSpell
?
"spell"
:
"trap"
);
sb
.
Replace
(
"%level%"
,
MSEConvert
.
GetST
(
c
)
);
sb
.
Replace
(
"%image%"
,
img
);
sb
.
Replace
(
"%desc%"
,
MSEConvert
.
ReDesc
(
c
.
desc
));
sb
.
Replace
(
"%code%"
,
c
.
id
.
ToString
(
"00000000"
));
return
sb
.
ToString
();
}
}
}
DataEditorX/Core/MSEConvert.cs
View file @
02392a2d
...
...
@@ -9,6 +9,8 @@
using
System.Text
;
using
System.Collections.Generic
;
using
System.Text.RegularExpressions
;
using
Microsoft.VisualBasic
;
using
System.Configuration
;
namespace
DataEditorX.Core
{
...
...
@@ -17,6 +19,7 @@ namespace DataEditorX.Core
/// </summary>
public
class
MSEConvert
{
static
bool
Iscn2tw
;
static
Dictionary
<
long
,
string
>
mTypedic
=
null
;
static
Dictionary
<
long
,
string
>
mRacedic
=
null
;
public
static
void
Init
(
Dictionary
<
long
,
string
>
typedic
,
...
...
@@ -24,10 +27,46 @@ public class MSEConvert
{
mTypedic
=
typedic
;
mRacedic
=
racedic
;
string
tmp
=
ConfigurationManager
.
AppSettings
[
"mse-cn2tw"
];
if
(
tmp
!=
null
&&
tmp
.
ToLower
()==
"true"
)
Iscn2tw
=
true
;
else
Iscn2tw
=
false
;
}
public
static
string
GetST
(
Card
c
)
{
string
level
;
if
(
c
.
IsType
(
CardType
.
TYPE_EQUIP
))
level
=
"+"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_QUICKPLAY
))
level
=
"$"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_FIELD
))
level
=
"&"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_CONTINUOUS
))
level
=
"%"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_RITUAL
))
level
=
"#"
;
else
if
(
c
.
IsType
(
CardType
.
TYPE_COUNTER
))
level
=
"!"
;
else
level
=
"^"
;
return
level
;
}
public
static
string
cn2tw
(
string
str
)
{
if
(
Iscn2tw
){
str
=
Strings
.
StrConv
(
str
,
VbStrConv
.
TraditionalChinese
,
0
);
str
=
str
.
Replace
(
"巖"
,
"岩"
);
}
return
str
;
}
public
static
string
ReDesc
(
string
desc
)
{
desc
=
cn2tw
(
desc
);
StringBuilder
sb
=
new
StringBuilder
(
MSE
.
reItalic
(
desc
));
sb
.
Replace
(
Environment
.
NewLine
,
"\n"
);
sb
.
Replace
(
"\n\n"
,
"\n"
);
sb
.
Replace
(
"\n"
,
"\n\t\t"
);
...
...
@@ -124,7 +163,7 @@ static string GetType(CardType type)
if
(
mTypedic
==
null
)
return
""
;
if
(
mTypedic
.
ContainsKey
(
key
))
return
mTypedic
[
key
].
Trim
(
);
return
cn2tw
(
mTypedic
[
key
].
Trim
()
);
return
""
;
}
...
...
@@ -144,7 +183,7 @@ public static string GetRace(long race)
if
(
mRacedic
==
null
)
return
""
;
if
(
mRacedic
.
ContainsKey
(
race
))
return
mRacedic
[
race
]
;
return
cn2tw
(
mRacedic
[
race
])
;
return
""
;
}
...
...
DataEditorX/DataEditForm.cs
View file @
02392a2d
...
...
@@ -97,12 +97,12 @@ void DataEditFormLoad(object sender, EventArgs e)
//设置空白卡片
oldCard
=
new
Card
(
0
);
SetCard
(
oldCard
);
checkupdate
(
false
);
if
(
File
.
Exists
(
nowCdbFile
))
Open
(
nowCdbFile
);
#
if
!
DEBUG
checkupdate
(
false
);
#
endif
}
//窗体关闭
void
DataEditFormFormClosing
(
object
sender
,
FormClosingEventArgs
e
)
...
...
DataEditorX/DataEditorX.csproj
View file @
02392a2d
...
...
@@ -43,6 +43,7 @@
<BaseIntermediateOutputPath>
obj\
</BaseIntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Microsoft.VisualBasic"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Configuration"
/>
<Reference
Include=
"System.Data"
/>
...
...
DataEditorX/Properties/AssemblyInfo.cs
View file @
02392a2d
...
...
@@ -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
(
"1.
5.5.2
"
)]
[
assembly
:
AssemblyVersion
(
"1.
6.0.0
"
)]
DataEditorX/app.config
View file @
02392a2d
...
...
@@ -24,7 +24,8 @@
<
add
key
=
"image_xyz"
value
=
"24,51,128,128"
/>
<
add
key
=
"image_pendulum"
value
=
"14,46,149,120"
/>
<!--
MSE
-->
<
add
key
=
"mse-cn2tw"
value
=
"true"
/>
<
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
>
</
configuration
>
\ No newline at end of file
DataEditorX/chinese/mse-head.txt
View file @
02392a2d
...
...
@@ -2,7 +2,7 @@
game: yugioh
stylesheet: standard
set info:
language:
CN
language:
TW
edition: MSE Editrion
ST mark is text: yes
pendulum image is small: yes
\ No newline at end of file
DataEditorX/chinese/mse-italic.txt
View file @
02392a2d
\
鮟鱇
\ No newline at end of file
[\\]
[鮟|鱇]
[A-Z]
\ No newline at end of file
DataEditorX/readme.txt
View file @
02392a2d
[DataEditorX]1.
5.5.2
[DataEditorX]
[DataEditorX]1.
6.0.0
[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...
...
@@ -7,6 +7,15 @@
下载/更新:
Magic Set Editor 2/update/download.bat
★MSE存档生成设置
config文件,设置pendulum文本和普通文本的正则正则表达式,用来分离文本
mse-head MSE的风格设置文件
mse-monster 普通怪兽模版
mse-pendulum P怪兽模版
mse-spelltrap 魔陷模版
mse-italic 特数字替换,达到一个位置使用2种字体的效果
★支持关联cdb文件,命令参数启动。
关联cdb文件:
请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。
...
...
@@ -47,6 +56,9 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
1.6.0.0
增加简体转繁体功能
mse-italic.txt支持正则替换
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1
...
...
win32/DataEditorX.exe
View file @
02392a2d
No preview for this file type
win32/DataEditorX.exe.config
View file @
02392a2d
...
...
@@ -24,7 +24,8 @@
<
add
key
=
"image_xyz"
value
=
"24,51,128,128"
/>
<
add
key
=
"image_pendulum"
value
=
"14,46,149,120"
/>
<!--
MSE
-->
<
add
key
=
"mse-cn2tw"
value
=
"true"
/>
<
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
>
</
configuration
>
\ No newline at end of file
win32/chinese/mse-head.txt
View file @
02392a2d
...
...
@@ -2,7 +2,7 @@
game: yugioh
stylesheet: standard
set info:
language:
CN
language:
TW
edition: MSE Editrion
ST mark is text: yes
pendulum image is small: yes
\ No newline at end of file
win32/chinese/mse-italic.txt
View file @
02392a2d
\
鮟鱇
\ No newline at end of file
[\\]
[鮟|鱇]
[A-Z]
\ No newline at end of file
win32/readme.txt
View file @
02392a2d
[DataEditorX]1.
5.5.2
[DataEditorX]
[DataEditorX]1.
6.0.0
[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
...
...
@@ -7,6 +7,15 @@
下载/更新:
Magic Set Editor 2/update/download.bat
★MSE存档生成设置
config文件,设置pendulum文本和普通文本的正则正则表达式,用来分离文本
mse-head MSE的风格设置文件
mse-monster 普通怪兽模版
mse-pendulum P怪兽模版
mse-spelltrap 魔陷模版
mse-italic 特数字替换,达到一个位置使用2种字体的效果
★支持关联cdb文件,命令参数启动。
关联cdb文件:
请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。
...
...
@@ -47,6 +56,9 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史
1.6.0.0
增加简体转繁体功能
mse-italic.txt支持正则替换
1.5.5.2
增加MSE的mse-italic.txt
1.5.5.1
...
...
win32/win32.zip
View file @
02392a2d
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment