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
0
Issues
0
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
聖園ミカ
DataEditorX
Commits
9d62faef
Commit
9d62faef
authored
Dec 31, 2014
by
keyongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mse
parent
3d359917
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
204 additions
and
118 deletions
+204
-118
DataEditorX/Config/ConfHelper.cs
DataEditorX/Config/ConfHelper.cs
+74
-0
DataEditorX/Config/MSEConfig.cs
DataEditorX/Config/MSEConfig.cs
+66
-108
DataEditorX/Core/MseMaker.cs
DataEditorX/Core/MseMaker.cs
+4
-4
DataEditorX/Core/MseReader.cs
DataEditorX/Core/MseReader.cs
+10
-0
DataEditorX/Core/TaskHelper.cs
DataEditorX/Core/TaskHelper.cs
+2
-2
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+4
-2
DataEditorX/chinese/mse-config.txt
DataEditorX/chinese/mse-config.txt
+22
-1
DataEditorX/single.lua
DataEditorX/single.lua
+0
-0
win32/DataEditorX.exe
win32/DataEditorX.exe
+0
-0
win32/chinese/mse-config.txt
win32/chinese/mse-config.txt
+22
-1
win32/single.lua
win32/single.lua
+0
-0
No files found.
DataEditorX/Config/ConfHelper.cs
0 → 100644
View file @
9d62faef
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Globalization
;
namespace
DataEditorX.Config
{
public
class
ConfHelper
{
public
const
string
SEP_LINE
=
" "
;
public
static
string
getValue
(
string
line
)
{
int
t
=
line
.
IndexOf
(
'='
);
if
(
t
>
0
)
return
line
.
Substring
(
t
+
1
).
Trim
();
return
""
;
}
public
static
string
getValue1
(
string
word
)
{
int
i
=
word
.
IndexOf
(
SEP_LINE
);
if
(
i
>
0
)
return
word
.
Substring
(
0
,
i
);
return
""
;
}
public
static
string
getValue2
(
string
word
)
{
int
i
=
word
.
IndexOf
(
SEP_LINE
);
if
(
i
>
0
)
return
word
.
Substring
(
i
+
SEP_LINE
.
Length
);
return
""
;
}
public
static
string
getRegexValue
(
string
line
)
{
return
getRegex
(
getValue
(
line
));
}
public
static
string
getRegex
(
string
word
)
{
return
word
.
Replace
(
"\\n"
,
"\n"
).
Replace
(
"\\t"
,
"\t"
).
Replace
(
"\\s"
,
" "
);
}
public
static
bool
getBooleanValue
(
string
line
)
{
if
(
getValue
(
line
).
ToLower
()
==
"true"
)
return
true
;
else
return
false
;
}
public
static
int
getIntegerValue
(
string
line
,
int
defalut
)
{
int
i
;
try
{
i
=
int
.
Parse
(
getValue
(
line
));
return
i
;
}
catch
{}
return
defalut
;
}
public
static
void
DicAdd
(
Dictionary
<
long
,
string
>
dic
,
string
line
)
{
int
i
=
line
.
IndexOf
(
"0x"
);
int
j
=
(
i
>
0
)
?
line
.
IndexOf
(
SEP_LINE
,
i
+
1
)
:
-
1
;
if
(
j
>
0
)
{
string
strkey
=
line
.
Substring
(
i
+
2
,
j
-
i
-
1
);
string
strval
=
line
.
Substring
(
j
+
1
);
long
key
;
long
.
TryParse
(
strkey
,
NumberStyles
.
HexNumber
,
null
,
out
key
);
if
(!
dic
.
ContainsKey
(
key
))
dic
.
Add
(
key
,
strval
.
Trim
());
}
}
}
}
DataEditorX/Config/MSEConfig.cs
View file @
9d62faef
...
...
@@ -15,20 +15,6 @@
namespace
DataEditorX.Config
{
public
class
RegStr
{
public
RegStr
(
string
p
,
string
r
)
{
pstr
=
Re
(
p
);
rstr
=
Re
(
r
);
}
string
Re
(
string
str
)
{
return
str
.
Replace
(
"\\n"
,
"\n"
).
Replace
(
"\\t"
,
"\t"
).
Replace
(
"\\s"
,
" "
);
}
public
string
pstr
;
public
string
rstr
;
}
/// <summary>
/// Description of MSEConfig.
/// </summary>
...
...
@@ -64,88 +50,60 @@ public void init(string path)
string
tmp
=
MyPath
.
Combine
(
path
,
FILE_CONFIG
);
replaces
=
new
List
<
RegStr
>();
replaces
=
new
Dictionary
<
string
,
string
>();
typeDic
=
new
Dictionary
<
long
,
string
>();
raceDic
=
new
Dictionary
<
long
,
string
>();
//读取配置
if
(
File
.
Exists
(
tmp
))
{
if
(
!
File
.
Exists
(
tmp
))
return
;
string
[]
lines
=
File
.
ReadAllLines
(
tmp
,
Encoding
.
UTF8
);
foreach
(
string
line
in
lines
)
{
if
(
string
.
IsNullOrEmpty
(
line
)
||
line
.
StartsWith
(
"#"
))
continue
;
if
(
line
.
StartsWith
(
"cn2tw"
))
Iscn2tw
=
(
getValue
(
line
).
ToLower
()
==
"true"
)
?
true
:
false
;
Iscn2tw
=
ConfHelper
.
getBooleanValue
(
line
)
;
else
if
(
line
.
StartsWith
(
"spell"
))
str_spell
=
getValue
(
line
);
str_spell
=
ConfHelper
.
getValue
(
line
);
else
if
(
line
.
StartsWith
(
"trap"
))
str_trap
=
getValue
(
line
);
str_trap
=
ConfHelper
.
getValue
(
line
);
else
if
(
line
.
StartsWith
(
"pendulum-text"
))
regx_pendulum
=
getRegex
(
getValue
(
line
)
);
regx_pendulum
=
ConfHelper
.
getRegexValue
(
line
);
else
if
(
line
.
StartsWith
(
"monster-text"
))
regx_monster
=
getRegex
(
getValue
(
line
)
);
regx_monster
=
ConfHelper
.
getRegexValue
(
line
);
else
if
(
line
.
StartsWith
(
"maxcount"
))
int
.
TryParse
(
getValue
(
line
),
out
maxcount
);
maxcount
=
ConfHelper
.
getIntegerValue
(
line
,
0
);
else
if
(
line
.
StartsWith
(
"imagepath"
))
imagepath
=
MyPath
.
CheckDir
(
getValue
(
line
),
MyPath
.
Combine
(
path
,
"Images"
));
else
if
(
line
.
StartsWith
(
"replace"
))
{
string
word
=
getValue
(
line
);
int
t
=
word
.
IndexOf
(
" "
);
if
(
t
>
0
)
{
string
p
=
word
.
Substring
(
0
,
t
);
string
r
=
word
.
Substring
(
t
+
1
);
if
(!
string
.
IsNullOrEmpty
(
p
))
replaces
.
Add
(
new
RegStr
(
p
,
r
));
//如果路径不合法,则为后面的路径
imagepath
=
MyPath
.
CheckDir
(
ConfHelper
.
getValue
(
line
),
MyPath
.
Combine
(
path
,
"Images"
));
}
else
if
(
line
.
StartsWith
(
"replace"
))
{
//特数字替换
string
word
=
ConfHelper
.
getValue
(
line
);
string
p
=
ConfHelper
.
getRegex
(
ConfHelper
.
getValue1
(
word
));
string
r
=
ConfHelper
.
getRegex
(
ConfHelper
.
getValue2
(
word
));
if
(!
string
.
IsNullOrEmpty
(
p
))
replaces
.
Add
(
p
,
r
);
}
else
if
(
line
.
StartsWith
(
"race"
))
{
DicAdd
(
raceDic
,
line
);
{
//种族
ConfHelper
.
DicAdd
(
raceDic
,
line
);
}
else
if
(
line
.
StartsWith
(
"type"
))
{
DicAdd
(
typeDic
,
line
);
{
//类型
ConfHelper
.
DicAdd
(
typeDic
,
line
);
}
}
//判断魔法标志是否为纯符号
if
(
str_spell
==
"%%"
&&
str_trap
==
"%%"
)
st_is_symbol
=
true
;
else
st_is_symbol
=
false
;
}
else
{
Iscn2tw
=
false
;
}
}
void
DicAdd
(
Dictionary
<
long
,
string
>
dic
,
string
line
)
{
int
i
=
line
.
IndexOf
(
"0x"
);
int
j
=
(
i
>
0
)?
line
.
IndexOf
(
SEP_LINE
,
i
+
1
):-
1
;
if
(
j
>
0
)
{
string
strkey
=
line
.
Substring
(
i
+
2
,
j
-
i
-
1
);
string
strval
=
line
.
Substring
(
j
+
1
);
long
key
;
long
.
TryParse
(
strkey
,
NumberStyles
.
HexNumber
,
null
,
out
key
);
if
(!
dic
.
ContainsKey
(
key
))
dic
.
Add
(
key
,
strval
.
Trim
());
}
}
string
getRegex
(
string
word
)
{
return
word
.
Replace
(
"\\n"
,
"\n"
).
Replace
(
"\\t"
,
"\t"
);
}
string
getValue
(
string
line
)
{
int
t
=
line
.
IndexOf
(
'='
);
if
(
t
>
0
)
return
line
.
Substring
(
t
+
1
).
Trim
();
return
""
;
}
//每个存档最大数
public
int
maxcount
;
//图片路径
...
...
@@ -159,7 +117,7 @@ string getValue(string line)
//简体转繁体?
public
bool
Iscn2tw
;
//特数字替换
public
List
<
RegStr
>
replaces
;
public
Dictionary
<
string
,
string
>
replaces
;
//效果文正则提取
public
string
regx_pendulum
;
public
string
regx_monster
;
...
...
DataEditorX/Core/M
SE
.cs
→
DataEditorX/Core/M
seMaker
.cs
View file @
9d62faef
...
...
@@ -24,7 +24,7 @@ namespace DataEditorX.Core
/// <summary>
/// Description of MSE.
/// </summary>
public
class
M
SE
public
class
M
seMaker
{
MSEConfig
cfg
;
...
...
@@ -38,7 +38,7 @@ public string ImagePath
get
{
return
cfg
.
imagepath
;}
}
public
M
SE
(
MSEConfig
mcfg
)
public
M
seMaker
(
MSEConfig
mcfg
)
{
cfg
=
mcfg
;
}
...
...
@@ -46,9 +46,9 @@ public MSE(MSEConfig mcfg)
public
string
reItalic
(
string
str
)
{
str
=
cn2tw
(
str
);
foreach
(
RegStr
rs
in
cfg
.
replace
s
)
foreach
(
string
rs
in
cfg
.
replaces
.
Key
s
)
{
str
=
Regex
.
Replace
(
str
,
rs
.
pstr
,
rs
.
rstr
);
str
=
Regex
.
Replace
(
str
,
rs
,
cfg
.
replaces
[
rs
]
);
}
return
str
;
}
...
...
DataEditorX/Core/MseReader.cs
0 → 100644
View file @
9d62faef
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DataEditorX.Core
{
public
class
MseReader
{
}
}
DataEditorX/Core/TaskHelper.cs
View file @
9d62faef
...
...
@@ -41,7 +41,7 @@ public class TaskHelper
private
Card
[]
cardlist
;
private
string
[]
mArgs
;
private
ImageSet
imgSet
=
new
ImageSet
();
private
M
SE
mseHelper
;
private
M
seMaker
mseHelper
;
private
bool
isCancel
=
false
;
private
bool
isRun
=
false
;
private
BackgroundWorker
worker
;
...
...
@@ -49,7 +49,7 @@ public class TaskHelper
public
TaskHelper
(
string
datapath
,
BackgroundWorker
worker
,
MSEConfig
mcfg
)
{
this
.
worker
=
worker
;
mseHelper
=
new
M
SE
(
mcfg
);
mseHelper
=
new
M
seMaker
(
mcfg
);
imgSet
.
Init
();
}
public
bool
IsRuning
()
...
...
DataEditorX/DataEditorX.csproj
View file @
9d62faef
...
...
@@ -68,6 +68,7 @@
<DependentUpon>
CodeEditForm.cs
</DependentUpon>
</Compile>
<Compile
Include=
"Common\CheckUpdate.cs"
/>
<Compile
Include=
"Config\ConfHelper.cs"
/>
<Compile
Include=
"Controls\DoubleContorl.cs"
>
<SubType>
Component
</SubType>
</Compile>
...
...
@@ -93,8 +94,9 @@
<Compile
Include=
"Config\DataManager.cs"
/>
<Compile
Include=
"Config\ImageSet.cs"
/>
<Compile
Include=
"Core\LuaFunction.cs"
/>
<Compile
Include=
"Core\M
SE
.cs"
/>
<Compile
Include=
"Core\M
seMaker
.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"
>
...
...
@@ -202,7 +204,7 @@
<None
Include=
"chinese\mse-template.txt"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"
chinese\
single.lua"
>
<None
Include=
"single.lua"
>
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</None>
<None
Include=
"chinese\strings.conf"
>
...
...
DataEditorX/chinese/mse-config.txt
View file @
9d62faef
...
...
@@ -23,6 +23,25 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
########################### Read MSE set
#
type = card type
name = name
attribute = attribute
level = level
image = image
type1 = type 1
type2 = type 2
type3 = type 3
type4 = type 4
rule = rule text
atk = attack
def = defense
pscale1 = pendulum scale 1
pscale2 = pendulum scale 2
prule = pendulum text
code = gamecode
###########################
##race
race 0x1 战士族
race 0x2 魔法师族
...
...
@@ -48,6 +67,7 @@ race 0x100000 念动力族
race 0x200000 幻神兽族
race 0x400000 创造神族
race 0x800000 幻龙族
###########################
##type
type 0x1 怪兽
type 0x2 魔法
...
...
@@ -74,3 +94,4 @@ type 0x200000 反转
type 0x400000 卡通
type 0x800000 超量
type 0x1000000 灵摆
##########################
\ No newline at end of file
DataEditorX/
chinese/
single.lua
→
DataEditorX/single.lua
View file @
9d62faef
File moved
win32/DataEditorX.exe
View file @
9d62faef
No preview for this file type
win32/chinese/mse-config.txt
View file @
9d62faef
...
...
@@ -23,6 +23,25 @@ monster-text = [果|介|述|報]】\n([\S\s]*)
replace = ([鮟|鱇|・|·]) <i>$1</i>
#replace = \s <sym-auto>^</sym-auto>
#replace = ([A-Z]) <i>$1</i>
########################### Read MSE set
#
type = card type
name = name
attribute = attribute
level = level
image = image
type1 = type 1
type2 = type 2
type3 = type 3
type4 = type 4
rule = rule text
atk = attack
def = defense
pscale1 = pendulum scale 1
pscale2 = pendulum scale 2
prule = pendulum text
code = gamecode
###########################
##race
race 0x1 战士族
race 0x2 魔法师族
...
...
@@ -48,6 +67,7 @@ race 0x100000 念动力族
race 0x200000 幻神兽族
race 0x400000 创造神族
race 0x800000 幻龙族
###########################
##type
type 0x1 怪兽
type 0x2 魔法
...
...
@@ -74,3 +94,4 @@ type 0x200000 反转
type 0x400000 卡通
type 0x800000 超量
type 0x1000000 灵摆
##########################
\ No newline at end of file
win32/
chinese/
single.lua
→
win32/single.lua
View file @
9d62faef
File moved
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