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
1
Issues
1
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
2abe825f
Commit
2abe825f
authored
Jun 08, 2020
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code formats; Now use label as tooltip.
parent
bc0829bf
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
645 additions
and
367 deletions
+645
-367
DataEditorX/CodeEditForm.cs
DataEditorX/CodeEditForm.cs
+6
-6
DataEditorX/Common/ConfHelper.cs
DataEditorX/Common/ConfHelper.cs
+10
-10
DataEditorX/Common/MyBitmap.cs
DataEditorX/Common/MyBitmap.cs
+1
-1
DataEditorX/Common/MyPath.cs
DataEditorX/Common/MyPath.cs
+2
-2
DataEditorX/Common/ZipStorer.cs
DataEditorX/Common/ZipStorer.cs
+138
-138
DataEditorX/Config/DataManager.cs
DataEditorX/Config/DataManager.cs
+2
-2
DataEditorX/Config/ImageSet.cs
DataEditorX/Config/ImageSet.cs
+5
-5
DataEditorX/Config/MyConfig.cs
DataEditorX/Config/MyConfig.cs
+15
-15
DataEditorX/Controls/FastColoredTextBoxEx.cs
DataEditorX/Controls/FastColoredTextBoxEx.cs
+47
-10
DataEditorX/Controls/FastColoredTextBoxEx.resx
DataEditorX/Controls/FastColoredTextBoxEx.resx
+120
-0
DataEditorX/Controls/History.cs
DataEditorX/Controls/History.cs
+5
-3
DataEditorX/Core/CardEdit.cs
DataEditorX/Core/CardEdit.cs
+20
-26
DataEditorX/Core/Info/CardLink.cs
DataEditorX/Core/Info/CardLink.cs
+1
-1
DataEditorX/Core/Mse/CardPack.cs
DataEditorX/Core/Mse/CardPack.cs
+3
-3
DataEditorX/Core/Mse/MSEConfig.cs
DataEditorX/Core/Mse/MSEConfig.cs
+25
-25
DataEditorX/Core/Mse/MseMaker.cs
DataEditorX/Core/Mse/MseMaker.cs
+11
-11
DataEditorX/Core/TCGEditor/CardSet.cs
DataEditorX/Core/TCGEditor/CardSet.cs
+1
-1
DataEditorX/Core/TaskHelper.cs
DataEditorX/Core/TaskHelper.cs
+3
-3
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+18
-18
DataEditorX/DataEditorX.csproj
DataEditorX/DataEditorX.csproj
+4
-3
DataEditorX/MainForm.cs
DataEditorX/MainForm.cs
+2
-2
DataEditorX/data/constant.lua
DataEditorX/data/constant.lua
+71
-46
DataEditorX/data/strings.conf
DataEditorX/data/strings.conf
+135
-36
No files found.
DataEditorX/CodeEditForm.cs
View file @
2abe825f
...
...
@@ -51,15 +51,15 @@ void InitForm()
this
.
tooltipDic
=
new
SortedList
<
string
,
string
>();
this
.
InitializeComponent
();
//设置字体,大小
string
fontname
=
MyConfig
.
r
eadString
(
MyConfig
.
TAG_FONT_NAME
);
float
fontsize
=
MyConfig
.
r
eadFloat
(
MyConfig
.
TAG_FONT_SIZE
,
this
.
fctb
.
Font
.
Size
);
string
fontname
=
MyConfig
.
R
eadString
(
MyConfig
.
TAG_FONT_NAME
);
float
fontsize
=
MyConfig
.
R
eadFloat
(
MyConfig
.
TAG_FONT_SIZE
,
this
.
fctb
.
Font
.
Size
);
this
.
fctb
.
Font
=
new
Font
(
fontname
,
fontsize
);
if
(
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_IME
))
if
(
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_IME
))
{
this
.
fctb
.
ImeMode
=
ImeMode
.
On
;
}
if
(
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_WORDWRAP
))
if
(
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_WORDWRAP
))
{
this
.
fctb
.
WordWrap
=
true
;
}
...
...
@@ -68,7 +68,7 @@ void InitForm()
this
.
fctb
.
WordWrap
=
false
;
}
if
(
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_TAB2SPACES
))
if
(
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_TAB2SPACES
))
{
this
.
tabisspaces
=
true
;
}
...
...
@@ -370,7 +370,7 @@ void AboutToolStripMenuItemClick(object sender, EventArgs e)
MyMsg
.
Show
(
LanguageHelper
.
GetMsg
(
LMSG
.
About
)
+
"\t"
+
Application
.
ProductName
+
"\n"
+
LanguageHelper
.
GetMsg
(
LMSG
.
Version
)
+
"\t1.1.0.0\n"
+
LanguageHelper
.
GetMsg
(
LMSG
.
Author
)
+
"\t
菜菜
"
);
+
LanguageHelper
.
GetMsg
(
LMSG
.
Author
)
+
"\t
Nanahira & JoyJ
"
);
}
void
Menuitem_openClick
(
object
sender
,
EventArgs
e
)
...
...
DataEditorX/Common/ConfHelper.cs
View file @
2abe825f
...
...
@@ -16,7 +16,7 @@ public class ConfHelper
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public
static
string
g
etValue
(
string
line
)
public
static
string
G
etValue
(
string
line
)
{
int
t
=
line
.
IndexOf
(
'='
);
if
(
t
>
0
)
...
...
@@ -31,7 +31,7 @@ public static string getValue(string line)
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public
static
string
g
etValue1
(
string
word
)
public
static
string
G
etValue1
(
string
word
)
{
int
i
=
word
.
IndexOf
(
SEP_LINE
);
if
(
i
>
0
)
...
...
@@ -46,7 +46,7 @@ public static string getValue1(string word)
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public
static
string
g
etValue2
(
string
word
)
public
static
string
G
etValue2
(
string
word
)
{
int
i
=
word
.
IndexOf
(
SEP_LINE
);
if
(
i
>
0
)
...
...
@@ -61,16 +61,16 @@ public static string getValue2(string word)
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public
static
string
g
etMultLineValue
(
string
line
)
public
static
string
G
etMultLineValue
(
string
line
)
{
return
getRegex
(
g
etValue
(
line
));
return
GetRegex
(
G
etValue
(
line
));
}
/// <summary>
/// 替换特殊符
/// </summary>
/// <param name="word"></param>
/// <returns></returns>
public
static
string
g
etRegex
(
string
word
)
public
static
string
G
etRegex
(
string
word
)
{
StringBuilder
sb
=
new
StringBuilder
(
word
);
sb
.
Replace
(
"\\r"
,
"\r"
);
...
...
@@ -84,9 +84,9 @@ public static string getRegex(string word)
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public
static
bool
g
etBooleanValue
(
string
line
)
public
static
bool
G
etBooleanValue
(
string
line
)
{
if
(
g
etValue
(
line
).
ToLower
()
==
"true"
)
if
(
G
etValue
(
line
).
ToLower
()
==
"true"
)
{
return
true
;
}
...
...
@@ -101,12 +101,12 @@ public static bool getBooleanValue(string line)
/// <param name="line"></param>
/// <param name="defalut">失败的值</param>
/// <returns></returns>
public
static
int
g
etIntegerValue
(
string
line
,
int
defalut
)
public
static
int
G
etIntegerValue
(
string
line
,
int
defalut
)
{
int
i
;
try
{
i
=
int
.
Parse
(
g
etValue
(
line
));
i
=
int
.
Parse
(
G
etValue
(
line
));
return
i
;
}
catch
{}
...
...
DataEditorX/Common/MyBitmap.cs
View file @
2abe825f
...
...
@@ -14,7 +14,7 @@ namespace DataEditorX.Common
/// </summary>
public
static
class
MyBitmap
{
public
static
Bitmap
r
eadImage
(
string
file
)
public
static
Bitmap
R
eadImage
(
string
file
)
{
if
(!
File
.
Exists
(
file
))
{
...
...
DataEditorX/Common/MyPath.cs
View file @
2abe825f
...
...
@@ -110,7 +110,7 @@ public static string CheckDir(string dir,string defalut)
/// <param name="tag">前面</param>
/// <param name="lang"></param>
/// <returns></returns>
public
static
string
g
etFileName
(
string
tag
,
string
lang
)
public
static
string
G
etFileName
(
string
tag
,
string
lang
)
{
return
tag
+
"_"
+
lang
+
".txt"
;
}
...
...
@@ -120,7 +120,7 @@ public static string getFileName(string tag,string lang)
/// <param name="tag"></param>
/// <param name="file"></param>
/// <returns></returns>
public
static
string
g
etFullFileName
(
string
tag
,
string
file
)
public
static
string
G
etFullFileName
(
string
tag
,
string
file
)
{
string
name
=
Path
.
GetFileNameWithoutExtension
(
file
);
if
(!
name
.
StartsWith
(
tag
+
"_"
))
...
...
DataEditorX/Common/ZipStorer.cs
View file @
2abe825f
This diff is collapsed.
Click to expand it.
DataEditorX/Config/DataManager.cs
View file @
2abe825f
...
...
@@ -36,7 +36,7 @@ static string reReturn(string content)
text
=
text
.
Replace
(
"\r"
,
"\n"
);
return
text
;
}
public
static
string
s
ubString
(
string
content
,
string
tag
)
public
static
string
S
ubString
(
string
content
,
string
tag
)
{
Regex
reg
=
new
Regex
(
string
.
Format
(
@"{0}{1}\n([\S\s]*?)\n{2}"
,
TAG_START
,
tag
,
TAG_END
),
RegexOptions
.
Multiline
);
Match
mac
=
reg
.
Match
(
reReturn
(
content
));
...
...
@@ -57,7 +57,7 @@ public static string subString(string content, string tag)
/// <returns></returns>
public
static
Dictionary
<
long
,
string
>
Read
(
string
content
,
string
tag
)
{
return
Read
(
s
ubString
(
content
,
tag
));
return
Read
(
S
ubString
(
content
,
tag
));
}
/// <summary>
/// 从文件读取内容,按行读取
...
...
DataEditorX/Config/ImageSet.cs
View file @
2abe825f
...
...
@@ -23,20 +23,20 @@ public class ImageSet
//初始化
void
Init
()
{
this
.
normalArea
=
MyConfig
.
r
eadArea
(
MyConfig
.
TAG_IMAGE_OTHER
);
this
.
normalArea
=
MyConfig
.
R
eadArea
(
MyConfig
.
TAG_IMAGE_OTHER
);
this
.
xyzArea
=
MyConfig
.
r
eadArea
(
MyConfig
.
TAG_IMAGE_XYZ
);
this
.
xyzArea
=
MyConfig
.
R
eadArea
(
MyConfig
.
TAG_IMAGE_XYZ
);
this
.
pendulumArea
=
MyConfig
.
r
eadArea
(
MyConfig
.
TAG_IMAGE_PENDULUM
);
this
.
pendulumArea
=
MyConfig
.
R
eadArea
(
MyConfig
.
TAG_IMAGE_PENDULUM
);
int
[]
ints
=
MyConfig
.
r
eadIntegers
(
MyConfig
.
TAG_IMAGE_SIZE
,
4
);
int
[]
ints
=
MyConfig
.
R
eadIntegers
(
MyConfig
.
TAG_IMAGE_SIZE
,
4
);
this
.
w
=
ints
[
0
];
this
.
h
=
ints
[
1
];
this
.
W
=
ints
[
2
];
this
.
H
=
ints
[
3
];
this
.
quilty
=
MyConfig
.
r
eadInteger
(
MyConfig
.
TAG_IMAGE_QUILTY
,
95
);
this
.
quilty
=
MyConfig
.
R
eadInteger
(
MyConfig
.
TAG_IMAGE_QUILTY
,
95
);
}
/// <summary>
/// jpeg质量
...
...
DataEditorX/Config/MyConfig.cs
View file @
2abe825f
...
...
@@ -181,7 +181,7 @@ public class MyConfig : XMLReader
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public
static
string
r
eadString
(
string
key
)
public
static
string
R
eadString
(
string
key
)
{
return
GetAppConfig
(
key
);
}
...
...
@@ -191,9 +191,9 @@ public static string readString(string key)
/// <param name="key"></param>
/// <param name="def"></param>
/// <returns></returns>
public
static
int
r
eadInteger
(
string
key
,
int
def
)
public
static
int
R
eadInteger
(
string
key
,
int
def
)
{
if
(
int
.
TryParse
(
r
eadString
(
key
),
out
int
i
))
if
(
int
.
TryParse
(
R
eadString
(
key
),
out
int
i
))
{
return
i
;
}
...
...
@@ -206,9 +206,9 @@ public static int readInteger(string key, int def)
/// <param name="key"></param>
/// <param name="def"></param>
/// <returns></returns>
public
static
float
r
eadFloat
(
string
key
,
float
def
)
public
static
float
R
eadFloat
(
string
key
,
float
def
)
{
if
(
float
.
TryParse
(
r
eadString
(
key
),
out
float
i
))
if
(
float
.
TryParse
(
R
eadString
(
key
),
out
float
i
))
{
return
i
;
}
...
...
@@ -221,9 +221,9 @@ public static float readFloat(string key, float def)
/// <param name="key"></param>
/// <param name="length"></param>
/// <returns></returns>
public
static
int
[]
r
eadIntegers
(
string
key
,
int
length
)
public
static
int
[]
R
eadIntegers
(
string
key
,
int
length
)
{
string
temp
=
r
eadString
(
key
);
string
temp
=
R
eadString
(
key
);
int
[]
ints
=
new
int
[
length
];
string
[]
ws
=
string
.
IsNullOrEmpty
(
temp
)
?
null
:
temp
.
Split
(
','
);
...
...
@@ -241,9 +241,9 @@ public static int[] readIntegers(string key, int length)
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public
static
Area
r
eadArea
(
string
key
)
public
static
Area
R
eadArea
(
string
key
)
{
int
[]
ints
=
r
eadIntegers
(
key
,
4
);
int
[]
ints
=
R
eadIntegers
(
key
,
4
);
Area
a
=
new
Area
();
if
(
ints
!=
null
)
{
...
...
@@ -259,9 +259,9 @@ public static Area readArea(string key)
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public
static
bool
r
eadBoolean
(
string
key
,
bool
def
=
false
)
public
static
bool
R
eadBoolean
(
string
key
,
bool
def
=
false
)
{
string
val
=
r
eadString
(
key
);
string
val
=
R
eadString
(
key
);
if
(
"true"
.
Equals
(
val
,
StringComparison
.
OrdinalIgnoreCase
)){
return
true
;
}
...
...
@@ -280,7 +280,7 @@ public static bool readBoolean(string key,bool def=false)
/// <returns></returns>
public
static
string
GetLanguageFile
(
string
path
)
{
if
(
r
eadBoolean
(
TAG_CHECK_SYSLANG
)
&&
Directory
.
Exists
(
path
))
if
(
R
eadBoolean
(
TAG_CHECK_SYSLANG
)
&&
Directory
.
Exists
(
path
))
{
Save
(
TAG_CHECK_SYSLANG
,
"false"
);
string
[]
words
=
CultureInfo
.
InstalledUICulture
.
EnglishName
.
Split
(
' '
);
...
...
@@ -288,7 +288,7 @@ public static string GetLanguageFile(string path)
string
[]
files
=
Directory
.
GetFiles
(
path
);
foreach
(
string
file
in
files
)
{
string
name
=
MyPath
.
g
etFullFileName
(
MyConfig
.
TAG_LANGUAGE
,
file
);
string
name
=
MyPath
.
G
etFullFileName
(
MyConfig
.
TAG_LANGUAGE
,
file
);
if
(
string
.
IsNullOrEmpty
(
name
))
{
continue
;
...
...
@@ -301,7 +301,7 @@ public static string GetLanguageFile(string path)
}
}
}
return
MyPath
.
Combine
(
path
,
MyPath
.
g
etFileName
(
MyConfig
.
TAG_LANGUAGE
,
GetAppConfig
(
TAG_LANGUAGE
)));
return
MyPath
.
Combine
(
path
,
MyPath
.
G
etFileName
(
MyConfig
.
TAG_LANGUAGE
,
GetAppConfig
(
TAG_LANGUAGE
)));
}
/// <summary>
/// 卡片信息配置文件名
...
...
@@ -310,7 +310,7 @@ public static string GetLanguageFile(string path)
/// <returns></returns>
public
static
string
GetCardInfoFile
(
string
path
)
{
return
MyPath
.
Combine
(
path
,
MyPath
.
g
etFileName
(
MyConfig
.
TAG_CARDINFO
,
GetAppConfig
(
TAG_LANGUAGE
)));
return
MyPath
.
Combine
(
path
,
MyPath
.
G
etFileName
(
MyConfig
.
TAG_CARDINFO
,
GetAppConfig
(
TAG_LANGUAGE
)));
}
/// <summary>
/// 发送消息打开文件
...
...
DataEditorX/Controls/FastColoredTextBoxEx.cs
View file @
2abe825f
...
...
@@ -10,18 +10,21 @@
using
System.Drawing.Drawing2D
;
using
System.Windows.Forms
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
FastColoredTextBoxNS
{
public
class
FastColoredTextBoxEx
:
FastColoredTextBox
{
Point
lastMouseCoord
;
{
private
Label
lbTooltip
;
Point
lastMouseCoord
;
public
FastColoredTextBoxEx
()
:
base
()
{
this
.
SyntaxHighlighter
=
new
MySyntaxHighlighter
();
this
.
InitializeComponent
();
this
.
ToolTipDelay
=
1
;
this
.
TextChangedDelayed
+=
this
.
FctbTextChangedDelayed
;
}
public
new
event
EventHandler
<
ToolTipNeededEventArgs
>
ToolTipNeeded
;
protected
override
void
OnMouseMove
(
MouseEventArgs
e
)
...
...
@@ -61,13 +64,16 @@ protected override void OnToolTip()
if
(
ea
.
ToolTipText
!=
null
)
{
//show tooltip
this
.
ToolTip
.
ToolTipTitle
=
ea
.
ToolTipTitle
;
this
.
ToolTip
.
ToolTipIcon
=
ea
.
ToolTipIcon
;
lbTooltip
.
Text
=
$"
{
ea
.
ToolTipTitle
}
\r\n\r\n
{
ea
.
ToolTipText
}
"
;
lbTooltip
.
Location
=
new
Point
(
this
.
Size
.
Width
-
500
,
this
.
lastMouseCoord
.
Y
+
this
.
CharHeight
);
//this.ToolTip.ToolTipTitle = ea.ToolTipTitle;
//this.ToolTip.ToolTipIcon = ea.ToolTipIcon;
//ToolTip.SetToolTip(this, ea.ToolTipText);
this
.
ToolTip
.
Show
(
ea
.
ToolTipText
,
this
,
new
Point
(
this
.
lastMouseCoord
.
X
,
this
.
lastMouseCoord
.
Y
+
this
.
CharHeight
));
}
}
//this.ToolTip.Show(ea.ToolTipText, this, new Point(this.lastMouseCoord.X, this.lastMouseCoord.Y + this.CharHeight));
}
}
//高亮当前词
void
FctbTextChangedDelayed
(
object
sender
,
TextChangedEventArgs
e
)
{
...
...
@@ -101,5 +107,36 @@ void FctbTextChangedDelayed(object sender, TextChangedEventArgs e)
lastNonEmptyLine
=
i
;
}
}
}
private
void
InitializeComponent
()
{
this
.
lbTooltip
=
new
System
.
Windows
.
Forms
.
Label
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
)).
BeginInit
();
this
.
SuspendLayout
();
//
// lbTooltip
//
this
.
lbTooltip
.
AutoSize
=
true
;
this
.
lbTooltip
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Desktop
;
this
.
lbTooltip
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
15.75F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
0
)));
this
.
lbTooltip
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
lbTooltip
.
Location
=
new
System
.
Drawing
.
Point
(
221
,
117
);
this
.
lbTooltip
.
MaximumSize
=
new
System
.
Drawing
.
Size
(
480
,
0
);
this
.
lbTooltip
.
Name
=
"lbTooltip"
;
this
.
lbTooltip
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
28
);
this
.
lbTooltip
.
TabIndex
=
1
;
//
// FastColoredTextBoxEx
//
this
.
AutoScrollMinSize
=
new
System
.
Drawing
.
Size
(
27
,
14
);
this
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
Controls
.
Add
(
this
.
lbTooltip
);
this
.
Name
=
"FastColoredTextBoxEx"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
584
,
327
);
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
)).
EndInit
();
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
}
}
}
DataEditorX/Controls/FastColoredTextBoxEx.resx
0 → 100644
View file @
2abe825f
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
</root>
\ No newline at end of file
DataEditorX/Controls/History.cs
View file @
2abe825f
...
...
@@ -76,9 +76,11 @@ void AddHistorys(string[] lines)
}
public
void
AddHistory
(
string
file
)
{
List
<
string
>
tmplist
=
new
List
<
string
>();
//添加到开始
tmplist
.
Add
(
file
);
List
<
string
>
tmplist
=
new
List
<
string
>
{
//添加到开始
file
};
//添加旧记录
tmplist
.
AddRange
(
this
.
cdbhistory
.
ToArray
());
tmplist
.
AddRange
(
this
.
luahistory
.
ToArray
());
...
...
DataEditorX/Core/CardEdit.cs
View file @
2abe825f
...
...
@@ -29,12 +29,10 @@ public CardEdit(IDataForm dataform)
//添加
public
class
AddCommand
:
IBackableCommand
{
private
string
_undoSQL
;
readonly
CardEdit
cardedit
;
private
string
undoSQL
;
readonly
IDataForm
dataform
;
public
AddCommand
(
CardEdit
cardedit
)
{
this
.
cardedit
=
cardedit
;
this
.
dataform
=
cardedit
.
dataform
;
}
...
...
@@ -64,7 +62,7 @@ public bool Excute(params object[] args)
DataBase
.
GetInsertSQL
(
c
,
true
))
>=
2
)
{
MyMsg
.
Show
(
LMSG
.
AddSucceed
);
this
.
_
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
);
this
.
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
);
this
.
dataform
.
Search
(
true
);
this
.
dataform
.
SetCard
(
c
);
return
true
;
...
...
@@ -74,7 +72,7 @@ public bool Excute(params object[] args)
}
public
void
Undo
()
{
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
_
undoSQL
);
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
undoSQL
);
}
public
object
Clone
()
...
...
@@ -88,16 +86,14 @@ public object Clone()
//修改
public
class
ModCommand
:
IBackableCommand
{
private
string
_
undoSQL
;
private
string
undoSQL
;
private
bool
modifiled
=
false
;
private
long
oldid
;
private
long
newid
;
private
bool
delold
;
readonly
CardEdit
cardedit
;
readonly
IDataForm
dataform
;
public
ModCommand
(
CardEdit
cardedit
)
{
this
.
cardedit
=
cardedit
;
this
.
dataform
=
cardedit
.
dataform
;
}
...
...
@@ -138,12 +134,12 @@ public bool Excute(params object[] args)
}
else
{
//删除成功,添加还原sql
this
.
_
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
)
+
DataBase
.
GetInsertSQL
(
oldCard
,
false
);
this
.
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
)
+
DataBase
.
GetInsertSQL
(
oldCard
,
false
);
}
}
else
{
this
.
_
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
);
//还原就是删除
this
.
undoSQL
=
DataBase
.
GetDeleteSQL
(
c
);
//还原就是删除
}
//如果删除旧卡片,则把资源修改名字,否则复制资源
if
(
modfiles
)
...
...
@@ -166,7 +162,7 @@ public bool Excute(params object[] args)
else
{
//更新数据
sql
=
DataBase
.
GetUpdateSQL
(
c
);
this
.
_
undoSQL
=
DataBase
.
GetUpdateSQL
(
oldCard
);
this
.
undoSQL
=
DataBase
.
GetUpdateSQL
(
oldCard
);
}
if
(
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
sql
)
>
0
)
{
...
...
@@ -185,7 +181,7 @@ public bool Excute(params object[] args)
public
void
Undo
()
{
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
_
undoSQL
);
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
undoSQL
);
if
(
this
.
modifiled
)
{
if
(
this
.
delold
)
...
...
@@ -210,12 +206,10 @@ public object Clone()
//删除
public
class
DelCommand
:
IBackableCommand
{
private
string
_undoSQL
;
readonly
CardEdit
cardedit
;
private
string
undoSQL
;
readonly
IDataForm
dataform
;
public
DelCommand
(
CardEdit
cardedit
)
{
this
.
cardedit
=
cardedit
;
this
.
dataform
=
cardedit
.
dataform
;
}
...
...
@@ -255,7 +249,7 @@ public bool Excute(params object[] args)
{
MyMsg
.
Show
(
LMSG
.
DeleteSucceed
);
this
.
dataform
.
Search
(
true
);
this
.
_
undoSQL
=
undo
;
this
.
undoSQL
=
undo
;
return
true
;
}
else
...
...
@@ -267,7 +261,7 @@ public bool Excute(params object[] args)
}
public
void
Undo
()
{
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
_
undoSQL
);
DataBase
.
Command
(
this
.
dataform
.
GetOpenFile
(),
this
.
undoSQL
);
}
public
object
Clone
()
...
...
@@ -354,9 +348,9 @@ public bool OpenScript(bool openinthis, string addrequire)
public
class
CopyCommand
:
IBackableCommand
{
bool
copied
=
false
;
Card
[]
N
ewCards
;
Card
[]
n
ewCards
;
bool
replace
;
Card
[]
O
ldCards
;
Card
[]
o
ldCards
;
readonly
CardEdit
cardedit
;
readonly
IDataForm
dataform
;
public
CopyCommand
(
CardEdit
cardedit
)
...
...
@@ -406,15 +400,15 @@ public bool Excute(params object[] args)
}
DataBase
.
CopyDB
(
this
.
dataform
.
GetOpenFile
(),
!
replace
,
cards
);
this
.
copied
=
true
;
this
.
N
ewCards
=
cards
;
this
.
n
ewCards
=
cards
;
this
.
replace
=
replace
;
this
.
O
ldCards
=
oldcards
;
this
.
o
ldCards
=
oldcards
;
return
true
;
}
public
void
Undo
()
{
DataBase
.
DeleteDB
(
this
.
dataform
.
GetOpenFile
(),
this
.
N
ewCards
);
DataBase
.
CopyDB
(
this
.
dataform
.
GetOpenFile
(),
!
this
.
replace
,
this
.
O
ldCards
);
DataBase
.
DeleteDB
(
this
.
dataform
.
GetOpenFile
(),
this
.
n
ewCards
);
DataBase
.
CopyDB
(
this
.
dataform
.
GetOpenFile
(),
!
this
.
replace
,
this
.
o
ldCards
);
}
public
object
Clone
()
...
...
@@ -422,12 +416,12 @@ public object Clone()
CopyCommand
replica
=
new
CopyCommand
(
this
.
cardedit
)
{
copied
=
this
.
copied
,
NewCards
=
(
Card
[])
this
.
N
ewCards
.
Clone
(),
newCards
=
(
Card
[])
this
.
n
ewCards
.
Clone
(),
replace
=
this
.
replace
};
if
(
this
.
O
ldCards
!=
null
)
if
(
this
.
o
ldCards
!=
null
)
{
replica
.
OldCards
=
(
Card
[])
this
.
O
ldCards
.
Clone
();
replica
.
oldCards
=
(
Card
[])
this
.
o
ldCards
.
Clone
();
}
return
replica
;
...
...
DataEditorX/Core/Info/CardLink.cs
View file @
2abe825f
...
...
@@ -30,7 +30,7 @@ public static class CardLink
public
const
int
Up
=
0x80
;
public
const
int
UpRight
=
0x100
;
public
static
bool
i
sLink
(
int
marks
,
int
mark
){
public
static
bool
I
sLink
(
int
marks
,
int
mark
){
return
(
marks
&
mark
)
==
mark
;
}
}
...
...
DataEditorX/Core/Mse/CardPack.cs
View file @
2abe825f
...
...
@@ -17,10 +17,10 @@ public class CardPack
{
public
CardPack
(
long
id
)
{
this
.
card_i
d
=
id
;
this
.
CardI
d
=
id
;
}
public
long
card_i
d
{
public
long
CardI
d
{
get
;
private
set
;
}
...
...
@@ -29,7 +29,7 @@ public CardPack(long id)
public
string
rarity
;
public
string
date
;
public
string
g
etMseRarity
(){
public
string
G
etMseRarity
(){
if
(
this
.
rarity
==
null
)
{
return
"common"
;
...
...
DataEditorX/Core/Mse/MSEConfig.cs
View file @
2abe825f
...
...
@@ -63,7 +63,7 @@ public class MSEConfig
#
endregion
public
MSEConfig
(
string
path
)
{
this
.
i
nit
(
path
);
this
.
I
nit
(
path
);
}
public
void
SetConfig
(
string
config
,
string
path
)
{
...
...
@@ -75,7 +75,7 @@ public void SetConfig(string config, string path)
this
.
regx_monster
=
"(\\s\\S*?)"
;
this
.
regx_pendulum
=
"(\\s\\S*?)"
;
//设置文件名
this
.
configName
=
MyPath
.
g
etFullFileName
(
MSEConfig
.
TAG
,
config
);
this
.
configName
=
MyPath
.
G
etFullFileName
(
MSEConfig
.
TAG
,
config
);
this
.
replaces
=
new
SortedList
<
string
,
string
>();
...
...
@@ -91,56 +91,56 @@ public void SetConfig(string config, string path)
if
(
line
.
StartsWith
(
TAG_CN2TW
))
{
this
.
Iscn2tw
=
ConfHelper
.
g
etBooleanValue
(
line
);
this
.
Iscn2tw
=
ConfHelper
.
G
etBooleanValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_SPELL
))
{
this
.
str_spell
=
ConfHelper
.
g
etValue
(
line
);
this
.
str_spell
=
ConfHelper
.
G
etValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_HEAD
))
{
this
.
head
=
ConfHelper
.
g
etMultLineValue
(
line
);
this
.
head
=
ConfHelper
.
G
etMultLineValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_END
))
{
this
.
end
=
ConfHelper
.
g
etMultLineValue
(
line
);
this
.
end
=
ConfHelper
.
G
etMultLineValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_TEXT
))
{
this
.
temp_text
=
ConfHelper
.
g
etMultLineValue
(
line
);
this
.
temp_text
=
ConfHelper
.
G
etMultLineValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_TRAP
))
{
this
.
str_trap
=
ConfHelper
.
g
etValue
(
line
);
this
.
str_trap
=
ConfHelper
.
G
etValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_REG_PENDULUM
))
{
this
.
regx_pendulum
=
ConfHelper
.
g
etValue
(
line
);
this
.
regx_pendulum
=
ConfHelper
.
G
etValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_REG_MONSTER
))
{
this
.
regx_monster
=
ConfHelper
.
g
etValue
(
line
);
this
.
regx_monster
=
ConfHelper
.
G
etValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_MAXCOUNT
))
{
this
.
maxcount
=
ConfHelper
.
g
etIntegerValue
(
line
,
0
);
this
.
maxcount
=
ConfHelper
.
G
etIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_WIDTH
)){
this
.
width
=
ConfHelper
.
g
etIntegerValue
(
line
,
0
);
this
.
width
=
ConfHelper
.
G
etIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_HEIGHT
)){
this
.
height
=
ConfHelper
.
g
etIntegerValue
(
line
,
0
);
this
.
height
=
ConfHelper
.
G
etIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_PEND_WIDTH
)){
this
.
pwidth
=
ConfHelper
.
g
etIntegerValue
(
line
,
0
);
this
.
pwidth
=
ConfHelper
.
G
etIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_PEND_HEIGHT
)){
this
.
pheight
=
ConfHelper
.
g
etIntegerValue
(
line
,
0
);
this
.
pheight
=
ConfHelper
.
G
etIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_NO_TEN
)){
this
.
no10
=
ConfHelper
.
g
etBooleanValue
(
line
);
this
.
no10
=
ConfHelper
.
G
etBooleanValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_NO_START_CARDS
)){
string
val
=
ConfHelper
.
g
etValue
(
line
);
string
val
=
ConfHelper
.
G
etValue
(
line
);
string
[]
cs
=
val
.
Split
(
','
);
this
.
noStartCards
=
new
long
[
cs
.
Length
];
int
i
=
0
;
...
...
@@ -152,16 +152,16 @@ public void SetConfig(string config, string path)
else
if
(
line
.
StartsWith
(
TAG_IMAGE
))
{
//如果路径不合法,则为后面的路径
this
.
imagepath
=
MyPath
.
CheckDir
(
ConfHelper
.
g
etValue
(
line
),
MyPath
.
Combine
(
path
,
PATH_IMAGE
));
this
.
imagepath
=
MyPath
.
CheckDir
(
ConfHelper
.
G
etValue
(
line
),
MyPath
.
Combine
(
path
,
PATH_IMAGE
));
//图片缓存目录
this
.
imagecache
=
MyPath
.
Combine
(
this
.
imagepath
,
"cache"
);
MyPath
.
CreateDir
(
this
.
imagecache
);
}
else
if
(
line
.
StartsWith
(
TAG_REPALCE
))
{
//特数字替换
string
word
=
ConfHelper
.
g
etValue
(
line
);
string
p
=
ConfHelper
.
getRegex
(
ConfHelper
.
g
etValue1
(
word
));
string
r
=
ConfHelper
.
getRegex
(
ConfHelper
.
g
etValue2
(
word
));
string
word
=
ConfHelper
.
G
etValue
(
line
);
string
p
=
ConfHelper
.
GetRegex
(
ConfHelper
.
G
etValue1
(
word
));
string
r
=
ConfHelper
.
GetRegex
(
ConfHelper
.
G
etValue2
(
word
));
if
(!
string
.
IsNullOrEmpty
(
p
))
{
this
.
replaces
.
Add
(
p
,
r
);
...
...
@@ -175,20 +175,20 @@ public void SetConfig(string config, string path)
{
//类型
ConfHelper
.
DicAdd
(
this
.
typeDic
,
line
);
}
else
if
(
line
.
StartsWith
(
TAG_REIMAGE
)){
this
.
reimage
=
ConfHelper
.
g
etBooleanValue
(
line
);
this
.
reimage
=
ConfHelper
.
G
etBooleanValue
(
line
);
}
}
}
public
void
i
nit
(
string
path
)
public
void
I
nit
(
string
path
)
{
this
.
Iscn2tw
=
false
;
//读取配置
string
tmp
=
MyPath
.
Combine
(
path
,
MyPath
.
getFileName
(
MSEConfig
.
TAG
,
MyConfig
.
r
eadString
(
MyConfig
.
TAG_MSE
)));
string
tmp
=
MyPath
.
Combine
(
path
,
MyPath
.
GetFileName
(
MSEConfig
.
TAG
,
MyConfig
.
R
eadString
(
MyConfig
.
TAG_MSE
)));
if
(!
File
.
Exists
(
tmp
))
{
tmp
=
MyPath
.
Combine
(
path
,
MyPath
.
g
etFileName
(
MSEConfig
.
TAG
,
FILE_CONFIG_NAME
));
tmp
=
MyPath
.
Combine
(
path
,
MyPath
.
G
etFileName
(
MSEConfig
.
TAG
,
FILE_CONFIG_NAME
));
if
(!
File
.
Exists
(
tmp
))
{
return
;
//如果默认的也不存在
...
...
DataEditorX/Core/Mse/MseMaker.cs
View file @
2abe825f
...
...
@@ -447,32 +447,32 @@ string getMonster(Card c, string img,CardPack cardpack=null,bool rarity=true)
if
(
cardpack
!=
null
){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_NUMBER
,
cardpack
.
pack_id
));
if
(
rarity
){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_RARITY
,
cardpack
.
g
etMseRarity
()));
sb
.
AppendLine
(
this
.
GetLine
(
TAG_RARITY
,
cardpack
.
G
etMseRarity
()));
}
}
if
(
c
.
IsType
(
CardType
.
TYPE_LINK
)){
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
DownLeft
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
DownLeft
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_DL
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
Down
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
Down
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_Down
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
DownRight
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
DownRight
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_DR
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
UpLeft
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
UpLeft
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_UL
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
Up
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
Up
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_Up
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
UpRight
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
UpRight
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_UR
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
Left
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
Left
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_Left
,
"yes"
));
}
if
(
CardLink
.
i
sLink
(
c
.
def
,
CardLink
.
Right
)){
if
(
CardLink
.
I
sLink
(
c
.
def
,
CardLink
.
Right
)){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Marker_Right
,
"yes"
));
}
sb
.
AppendLine
(
this
.
GetLine
(
TAG_Link_Number
,
""
+
this
.
getLinkNumber
(
c
.
def
)));
...
...
@@ -520,7 +520,7 @@ string getSpellTrap(Card c, string img, bool isSpell,CardPack cardpack=null,bool
if
(
cardpack
!=
null
){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_NUMBER
,
cardpack
.
pack_id
));
if
(
rarity
){
sb
.
AppendLine
(
this
.
GetLine
(
TAG_RARITY
,
cardpack
.
g
etMseRarity
()));
sb
.
AppendLine
(
this
.
GetLine
(
TAG_RARITY
,
cardpack
.
G
etMseRarity
()));
}
}
sb
.
AppendLine
(
" "
+
TAG_TEXT
+
":"
);
...
...
@@ -888,7 +888,7 @@ public Card[] ReadCards(string set, bool repalceOld)
string
file
=
MyPath
.
Combine
(
this
.
cfg
.
imagecache
,
md5
);
if
(!
File
.
Exists
(
file
)){
//生成缓存
Bitmap
bmp
=
MyBitmap
.
r
eadImage
(
img
);
Bitmap
bmp
=
MyBitmap
.
R
eadImage
(
img
);
//缩放
if
(
isPendulum
){
bmp
=
MyBitmap
.
Zoom
(
bmp
,
this
.
cfg
.
pwidth
,
this
.
cfg
.
pheight
);
...
...
DataEditorX/Core/TCGEditor/CardSet.cs
View file @
2abe825f
...
...
@@ -48,7 +48,7 @@ public override string ToString()
}
public
class
CardJson
{
public
static
void
t
est
(){
public
static
void
T
est
(){
string
json
=
File
.
ReadAllText
(
@"F:\TCGEditor_v1.2\t.tcgb"
);
CardSet
cardset
=
JsonConvert
.
DeserializeObject
<
CardSet
>(
json
);
if
(
cardset
.
cards
!=
null
){
...
...
DataEditorX/Core/TaskHelper.cs
View file @
2abe825f
...
...
@@ -136,7 +136,7 @@ public void ToImg(string img, string saveimg1)
#
region
检查更新
public
static
void
CheckVersion
(
bool
showNew
)
{
string
newver
=
CheckUpdate
.
GetNewVersion
(
MyConfig
.
r
eadString
(
MyConfig
.
TAG_UPDATE_URL
));
string
newver
=
CheckUpdate
.
GetNewVersion
(
MyConfig
.
R
eadString
(
MyConfig
.
TAG_UPDATE_URL
));
if
(
newver
==
CheckUpdate
.
DEFALUT
)
{
//检查失败
if
(!
showNew
)
...
...
@@ -284,8 +284,8 @@ public void SaveMSEs(string file, Card[] cards,bool isUpdate)
return
;
}
string
pack_db
=
MyPath
.
GetRealPath
(
MyConfig
.
r
eadString
(
"pack_db"
));
bool
rarity
=
MyConfig
.
r
eadBoolean
(
"mse_auto_rarity"
,
false
);
string
pack_db
=
MyPath
.
GetRealPath
(
MyConfig
.
R
eadString
(
"pack_db"
));
bool
rarity
=
MyConfig
.
R
eadBoolean
(
"mse_auto_rarity"
,
false
);
#
if
DEBUG
MessageBox
.
Show
(
"db = "
+
pack_db
+
",auto rarity="
+
rarity
);
#
endif
...
...
DataEditorX/DataEditForm.cs
View file @
2abe825f
...
...
@@ -101,7 +101,7 @@ public DataEditForm(string datapath)
}
public
DataEditForm
()
{
//默认启动
string
dir
=
MyConfig
.
r
eadString
(
MyConfig
.
TAG_DATA
);
string
dir
=
MyConfig
.
R
eadString
(
MyConfig
.
TAG_DATA
);
if
(
string
.
IsNullOrEmpty
(
dir
))
{
Application
.
Exit
();
...
...
@@ -171,13 +171,13 @@ void DataEditFormLoad(object sender, EventArgs e)
this
.
oldCard
=
new
Card
(
0
);
this
.
SetCard
(
this
.
oldCard
);
//删除资源
this
.
menuitem_operacardsfile
.
Checked
=
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_DELETE_WITH
);
this
.
menuitem_operacardsfile
.
Checked
=
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_DELETE_WITH
);
//用CodeEditor打开脚本
this
.
menuitem_openfileinthis
.
Checked
=
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_OPEN_IN_THIS
);
this
.
menuitem_openfileinthis
.
Checked
=
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_OPEN_IN_THIS
);
//自动检查更新
this
.
menuitem_autocheckupdate
.
Checked
=
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_AUTO_CHECK_UPDATE
);
this
.
menuitem_autocheckupdate
.
Checked
=
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_AUTO_CHECK_UPDATE
);
//add require automatically
this
.
Addrequire
=
MyConfig
.
r
eadString
(
MyConfig
.
TAG_ADD_REQUIRE
);
this
.
Addrequire
=
MyConfig
.
R
eadString
(
MyConfig
.
TAG_ADD_REQUIRE
);
this
.
menuitem_addrequire
.
Checked
=
(
this
.
Addrequire
.
Length
>
0
);
if
(
this
.
nowCdbFile
!=
null
&&
File
.
Exists
(
this
.
nowCdbFile
))
{
...
...
@@ -295,7 +295,7 @@ void InitPath(string datapath)
this
.
confcover
=
MyPath
.
Combine
(
datapath
,
"cover.jpg"
);
if
(
File
.
Exists
(
this
.
confcover
))
{
this
.
cover
=
MyBitmap
.
r
eadImage
(
this
.
confcover
);
this
.
cover
=
MyBitmap
.
R
eadImage
(
this
.
confcover
);
}
else
{
...
...
@@ -567,7 +567,7 @@ long GetSelect(ComboBox cb)
}
List
<
long
>
keys
=
(
List
<
long
>)
cb
.
Tag
;
int
index
=
cb
.
SelectedIndex
;
if
(
index
>=
keys
.
Count
)
if
(
index
>=
keys
.
Count
||
index
<
0
)
{
return
0
;
}
...
...
@@ -1155,7 +1155,7 @@ void Menuitem_aboutClick(object sender, EventArgs e)
MyMsg
.
Show
(
LanguageHelper
.
GetMsg
(
LMSG
.
About
)
+
"\t"
+
Application
.
ProductName
+
"\n"
+
LanguageHelper
.
GetMsg
(
LMSG
.
Version
)
+
"\t"
+
Application
.
ProductVersion
+
"\n"
+
LanguageHelper
.
GetMsg
(
LMSG
.
Author
)
+
"\t
菜菜
"
);
+
LanguageHelper
.
GetMsg
(
LMSG
.
Author
)
+
"\t
Nanahira & JoyJ
"
);
}
void
Menuitem_checkupdateClick
(
object
sender
,
EventArgs
e
)
...
...
@@ -1197,7 +1197,7 @@ void Menuitem_cancelTaskClick(object sender, EventArgs e)
}
void
Menuitem_githubClick
(
object
sender
,
EventArgs
e
)
{
System
.
Diagnostics
.
Process
.
Start
(
MyConfig
.
r
eadString
(
MyConfig
.
TAG_SOURCE_URL
));
System
.
Diagnostics
.
Process
.
Start
(
MyConfig
.
R
eadString
(
MyConfig
.
TAG_SOURCE_URL
));
}
#
endregion
...
...
@@ -1630,12 +1630,12 @@ public void SetImage(long id)
string
msepic
=
MseMaker
.
GetCardImagePath
(
this
.
tasker
.
MSEImagePath
,
this
.
oldCard
);
if
(
File
.
Exists
(
msepic
))
{
this
.
pl_image
.
BackgroundImage
=
MyBitmap
.
r
eadImage
(
msepic
);
this
.
pl_image
.
BackgroundImage
=
MyBitmap
.
R
eadImage
(
msepic
);
}
}
else
if
(
File
.
Exists
(
pic
))
{
this
.
pl_image
.
BackgroundImage
=
MyBitmap
.
r
eadImage
(
pic
);
this
.
pl_image
.
BackgroundImage
=
MyBitmap
.
R
eadImage
(
pic
);
}
else
{
...
...
@@ -1779,7 +1779,7 @@ void AddMenuItemFormMSE()
string
[]
files
=
Directory
.
GetFiles
(
this
.
datapath
);
foreach
(
string
file
in
files
)
{
string
name
=
MyPath
.
g
etFullFileName
(
MSEConfig
.
TAG
,
file
);
string
name
=
MyPath
.
G
etFullFileName
(
MSEConfig
.
TAG
,
file
);
//是否是MSE配置文件
if
(
string
.
IsNullOrEmpty
(
name
))
{
...
...
@@ -1999,7 +1999,7 @@ void GetLanguageItem()
string
[]
files
=
Directory
.
GetFiles
(
this
.
datapath
);
foreach
(
string
file
in
files
)
{
string
name
=
MyPath
.
g
etFullFileName
(
MyConfig
.
TAG_LANGUAGE
,
file
);
string
name
=
MyPath
.
G
etFullFileName
(
MyConfig
.
TAG_LANGUAGE
,
file
);
if
(
string
.
IsNullOrEmpty
(
name
))
{
continue
;
...
...
@@ -2011,7 +2011,7 @@ void GetLanguageItem()
ToolTipText
=
file
};
tsmi
.
Click
+=
this
.
SetLanguage_Click
;
if
(
MyConfig
.
r
eadString
(
MyConfig
.
TAG_LANGUAGE
).
Equals
(
name
,
StringComparison
.
OrdinalIgnoreCase
))
if
(
MyConfig
.
R
eadString
(
MyConfig
.
TAG_LANGUAGE
).
Equals
(
name
,
StringComparison
.
OrdinalIgnoreCase
))
{
tsmi
.
Checked
=
true
;
}
...
...
@@ -2043,7 +2043,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
return
;
}
string
msepath
=
MyPath
.
GetRealPath
(
MyConfig
.
r
eadString
(
MyConfig
.
TAG_MSE_PATH
));
string
msepath
=
MyPath
.
GetRealPath
(
MyConfig
.
R
eadString
(
MyConfig
.
TAG_MSE_PATH
));
if
(!
File
.
Exists
(
msepath
)){
MyMsg
.
Error
(
LMSG
.
exportMseImagesErr
);
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
...
...
@@ -2065,7 +2065,7 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
string
mseset
=
dlg
.
FileName
;
string
exportpath
=
MyPath
.
GetRealPath
(
MyConfig
.
r
eadString
(
MyConfig
.
TAG_MSE_EXPORT
));
string
exportpath
=
MyPath
.
GetRealPath
(
MyConfig
.
R
eadString
(
MyConfig
.
TAG_MSE_EXPORT
));
MseMaker
.
ExportSet
(
msepath
,
mseset
,
exportpath
,
delegate
{
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
});
...
...
@@ -2123,7 +2123,7 @@ void Menuitem_autoreturnClick(object sender, EventArgs e)
if
(
DataBase
.
Create
(
dlg
.
FileName
))
{
//
int
len
=
MyConfig
.
r
eadInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
int
len
=
MyConfig
.
R
eadInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
cards
[
i
].
desc
!=
null
){
...
...
@@ -2160,7 +2160,7 @@ void Menuitem_replaceClick(object sender, EventArgs e)
if
(
DataBase
.
Create
(
dlg
.
FileName
))
{
//
_
=
MyConfig
.
r
eadInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
_
=
MyConfig
.
R
eadInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
cards
[
i
].
desc
!=
null
)
...
...
DataEditorX/DataEditorX.csproj
View file @
2abe825f
...
...
@@ -200,6 +200,9 @@
<EmbeddedResource
Include=
"CodeEditForm.resx"
>
<DependentUpon>
CodeEditForm.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"Controls\FastColoredTextBoxEx.resx"
>
<DependentUpon>
FastColoredTextBoxEx.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"DataEditForm.resx"
>
<DependentUpon>
DataEditForm.cs
</DependentUpon>
</EmbeddedResource>
...
...
@@ -232,8 +235,6 @@
<CopyToOutputDirectory>
PreserveNewest
</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"Core\TCGEditor"
/>
</ItemGroup>
<ItemGroup
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
DataEditorX/MainForm.cs
View file @
2abe825f
...
...
@@ -56,7 +56,7 @@ public void SetDataPath(string datapath)
this
.
tCards
=
null
;
//数据目录
this
.
datapath
=
datapath
;
if
(
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_ASYNC
))
if
(
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_ASYNC
))
{
//后台加载数据
this
.
bgWorker1
.
RunWorkerAsync
();
...
...
@@ -548,7 +548,7 @@ private void bgWorker1_RunWorkerCompleted(object sender, System.ComponentModel.R
private
void
MainForm_Load
(
object
sender
,
EventArgs
e
)
{
//检查更新
if
(!
MyConfig
.
r
eadBoolean
(
MyConfig
.
TAG_AUTO_CHECK_UPDATE
))
if
(!
MyConfig
.
R
eadBoolean
(
MyConfig
.
TAG_AUTO_CHECK_UPDATE
))
{
return
;
}
...
...
DataEditorX/data/constant.lua
View file @
2abe825f
This diff is collapsed.
Click to expand it.
DataEditorX/data/strings.conf
View file @
2abe825f
This diff is collapsed.
Click to expand it.
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