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
44764797
Commit
44764797
authored
Jun 10, 2020
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code format
parent
b448b34a
Pipeline
#87
passed with stage
in 49 seconds
Changes
48
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
3529 additions
and
3457 deletions
+3529
-3457
DataEditorX/CodeEditForm.cs
DataEditorX/CodeEditForm.cs
+27
-27
DataEditorX/Common/CheckUpdate.cs
DataEditorX/Common/CheckUpdate.cs
+26
-26
DataEditorX/Common/ConfHelper.cs
DataEditorX/Common/ConfHelper.cs
+3
-4
DataEditorX/Common/MyBitmap.cs
DataEditorX/Common/MyBitmap.cs
+12
-12
DataEditorX/Common/MyPath.cs
DataEditorX/Common/MyPath.cs
+56
-56
DataEditorX/Common/MySortList.cs
DataEditorX/Common/MySortList.cs
+30
-32
DataEditorX/Common/MyUtils.cs
DataEditorX/Common/MyUtils.cs
+38
-38
DataEditorX/Common/StrUtil.cs
DataEditorX/Common/StrUtil.cs
+37
-37
DataEditorX/Common/User32.cs
DataEditorX/Common/User32.cs
+7
-8
DataEditorX/Common/XMLReader.cs
DataEditorX/Common/XMLReader.cs
+1
-6
DataEditorX/Common/ZipStorer.cs
DataEditorX/Common/ZipStorer.cs
+18
-16
DataEditorX/Config/CodeConfig.cs
DataEditorX/Config/CodeConfig.cs
+3
-4
DataEditorX/Config/DataConfig.cs
DataEditorX/Config/DataConfig.cs
+3
-3
DataEditorX/Config/DataManager.cs
DataEditorX/Config/DataManager.cs
+6
-6
DataEditorX/Config/ImageSet.cs
DataEditorX/Config/ImageSet.cs
+8
-10
DataEditorX/Config/MyConfig.cs
DataEditorX/Config/MyConfig.cs
+38
-37
DataEditorX/Config/YgoPath.cs
DataEditorX/Config/YgoPath.cs
+50
-53
DataEditorX/Controls/DFlowLayoutPanel.cs
DataEditorX/Controls/DFlowLayoutPanel.cs
+1
-4
DataEditorX/Controls/DListBox.cs
DataEditorX/Controls/DListBox.cs
+1
-4
DataEditorX/Controls/DListView.cs
DataEditorX/Controls/DListView.cs
+1
-4
DataEditorX/Controls/FastColoredTextBoxEx.cs
DataEditorX/Controls/FastColoredTextBoxEx.cs
+28
-31
DataEditorX/Controls/History.cs
DataEditorX/Controls/History.cs
+6
-6
DataEditorX/Controls/IEditForm.cs
DataEditorX/Controls/IEditForm.cs
+1
-5
DataEditorX/Controls/MySyntaxHighlighter.cs
DataEditorX/Controls/MySyntaxHighlighter.cs
+22
-28
DataEditorX/Core/Card.cs
DataEditorX/Core/Card.cs
+136
-130
DataEditorX/Core/CardEdit.cs
DataEditorX/Core/CardEdit.cs
+269
-266
DataEditorX/Core/CommandManager.cs
DataEditorX/Core/CommandManager.cs
+75
-75
DataEditorX/Core/DataBase.cs
DataEditorX/Core/DataBase.cs
+415
-404
DataEditorX/Core/Info/CardAttribute.cs
DataEditorX/Core/Info/CardAttribute.cs
+0
-1
DataEditorX/Core/Info/CardLink.cs
DataEditorX/Core/Info/CardLink.cs
+17
-17
DataEditorX/Core/Info/CardRace.cs
DataEditorX/Core/Info/CardRace.cs
+0
-1
DataEditorX/Core/Info/CardRule.cs
DataEditorX/Core/Info/CardRule.cs
+1
-1
DataEditorX/Core/Info/CardType.cs
DataEditorX/Core/Info/CardType.cs
+185
-177
DataEditorX/Core/LuaFunction.cs
DataEditorX/Core/LuaFunction.cs
+272
-263
DataEditorX/Core/Mse/CardPack.cs
DataEditorX/Core/Mse/CardPack.cs
+86
-83
DataEditorX/Core/Mse/MSEConfig.cs
DataEditorX/Core/Mse/MSEConfig.cs
+165
-159
DataEditorX/Core/Mse/MSECons.cs
DataEditorX/Core/Mse/MSECons.cs
+1
-5
DataEditorX/Core/Mse/MseMaker.cs
DataEditorX/Core/Mse/MseMaker.cs
+792
-742
DataEditorX/Core/TCGEditor/CardSet.cs
DataEditorX/Core/TCGEditor/CardSet.cs
+64
-58
DataEditorX/Core/TaskHelper.cs
DataEditorX/Core/TaskHelper.cs
+375
-379
DataEditorX/Core/YGOUtil.cs
DataEditorX/Core/YGOUtil.cs
+34
-35
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+168
-141
DataEditorX/Language/LMsg.cs
DataEditorX/Language/LMsg.cs
+4
-5
DataEditorX/Language/LanguageHelper.cs
DataEditorX/Language/LanguageHelper.cs
+2
-2
DataEditorX/Language/MyMsg.cs
DataEditorX/Language/MyMsg.cs
+15
-20
DataEditorX/MainForm.cs
DataEditorX/MainForm.cs
+19
-21
DataEditorX/Program.cs
DataEditorX/Program.cs
+11
-14
DataEditorX/Properties/AssemblyInfo.cs
DataEditorX/Properties/AssemblyInfo.cs
+0
-1
No files found.
DataEditorX/CodeEditForm.cs
View file @
44764797
...
...
@@ -5,19 +5,19 @@
* 时间: 19:16
*
*/
using
DataEditorX.Config
;
using
DataEditorX.Controls
;
using
DataEditorX.Core
;
using
DataEditorX.Language
;
using
FastColoredTextBoxNS
;
using
System
;
using
System.IO
;
using
System.Drawing
;
using
System.Collections.Generic
;
using
System.Windows.Forms
;
using
System.Drawing
;
using
System.IO
;
using
System.Text
;
using
WeifenLuo.WinFormsUI.Docking
;
using
FastColoredTextBoxNS
;
using
DataEditorX.Language
;
using
System.Text.RegularExpressions
;
using
DataEditorX.Core
;
using
DataEditorX.Config
;
using
DataEditorX.Controls
;
using
System.Windows.Forms
;
using
WeifenLuo.WinFormsUI.Docking
;
namespace
DataEditorX
{
...
...
@@ -91,8 +91,8 @@ void InitForm()
this
.
popupMenu
.
ForeColor
=
this
.
fctb
.
ForeColor
;
this
.
popupMenu
.
Closed
+=
new
ToolStripDropDownClosedEventHandler
(
this
.
popupMenu_Closed
);
this
.
popupMenu
.
SelectedColor
=
Color
.
LightGray
;
popupMenu
.
VisibleChanged
+=
this
.
PopupMenu_VisibleChanged
;
popupMenu
.
Items
.
FocussedItemIndexChanged
+=
this
.
Items_FocussedItemIndexChanged
;
this
.
popupMenu
.
VisibleChanged
+=
this
.
PopupMenu_VisibleChanged
;
this
.
popupMenu
.
Items
.
FocussedItemIndexChanged
+=
this
.
Items_FocussedItemIndexChanged
;
this
.
title
=
this
.
Text
;
}
...
...
@@ -105,38 +105,38 @@ private void ToolTip_Popup(object sender, PopupEventArgs e)
private
void
PopupMenu_VisibleChanged
(
object
sender
,
EventArgs
e
)
{
this
.
AdjustPopupMenuSize
();
if
(!
popupMenu
.
Visible
||
popupMenu
.
Items
.
FocussedItem
==
null
)
if
(!
this
.
popupMenu
.
Visible
||
this
.
popupMenu
.
Items
.
FocussedItem
==
null
)
{
return
;
}
this
.
fctb
.
ShowTooltipWithLabel
(
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
popupMenu
.
Items
.
FocussedItem
.
ToolTipText
);
this
.
fctb
.
ShowTooltipWithLabel
(
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipText
);
}
private
void
AdjustPopupMenuSize
()
{
if
(!
popupMenu
.
Visible
||
popupMenu
.
Items
.
FocussedItem
==
null
)
if
(!
this
.
popupMenu
.
Visible
||
this
.
popupMenu
.
Items
.
FocussedItem
==
null
)
{
popupMenu
.
Size
=
new
Size
(
300
,
0
);
popupMenu
.
MinimumSize
=
new
Size
(
300
,
0
);
this
.
popupMenu
.
Size
=
new
Size
(
300
,
0
);
this
.
popupMenu
.
MinimumSize
=
new
Size
(
300
,
0
);
}
Size
s
=
TextRenderer
.
MeasureText
(
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
popupMenu
.
Items
.
Font
,
new
Size
(
0
,
0
),
TextFormatFlags
.
NoPadding
);
s
=
new
Size
(
s
.
Width
+
50
,
popupMenu
.
Size
.
Height
);
if
(
popupMenu
.
Size
.
Width
<
s
.
Width
)
Size
s
=
TextRenderer
.
MeasureText
(
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
this
.
popupMenu
.
Items
.
Font
,
new
Size
(
0
,
0
),
TextFormatFlags
.
NoPadding
);
s
=
new
Size
(
s
.
Width
+
50
,
this
.
popupMenu
.
Size
.
Height
);
if
(
this
.
popupMenu
.
Size
.
Width
<
s
.
Width
)
{
popupMenu
.
Size
=
s
;
popupMenu
.
MinimumSize
=
s
;
this
.
popupMenu
.
Size
=
s
;
this
.
popupMenu
.
MinimumSize
=
s
;
}
}
private
void
Items_FocussedItemIndexChanged
(
object
sender
,
EventArgs
e
)
{
if
(
popupMenu
.
Items
.
FocussedItem
==
null
)
if
(
this
.
popupMenu
.
Items
.
FocussedItem
==
null
)
{
return
;
}
this
.
AdjustPopupMenuSize
();
this
.
fctb
.
ShowTooltipWithLabel
(
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
popupMenu
.
Items
.
FocussedItem
.
ToolTipText
);
this
.
fctb
.
ShowTooltipWithLabel
(
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipTitle
,
this
.
popupMenu
.
Items
.
FocussedItem
.
ToolTipText
);
}
void
popupMenu_Closed
(
object
sender
,
ToolStripDropDownClosedEventArgs
e
)
...
...
DataEditorX/Common/CheckUpdate.cs
View file @
44764797
...
...
@@ -64,9 +64,9 @@ public static string GetNewVersion(string VERURL)
public
static
bool
CheckVersion
(
string
ver
,
string
oldver
)
{
bool
hasNew
=
false
;
#
if
DEBUG
System
.
Windows
.
Forms
.
MessageBox
.
Show
(
oldver
+
"=>"
+
ver
);
#
endif
#if DEBUG
System
.
Windows
.
Forms
.
MessageBox
.
Show
(
oldver
+
"=>"
+
ver
);
#endif
string
[]
vers
=
ver
.
Split
(
'.'
);
string
[]
oldvers
=
oldver
.
Split
(
'.'
);
if
(
vers
.
Length
==
oldvers
.
Length
)
...
...
DataEditorX/Common/ConfHelper.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Text
;
namespace
DataEditorX.Common
{
...
...
@@ -109,7 +108,7 @@ public static int GetIntegerValue(string line, int defalut)
i
=
int
.
Parse
(
GetValue
(
line
));
return
i
;
}
catch
{
}
catch
{
}
return
defalut
;
}
/// <summary>
...
...
DataEditorX/Common/MyBitmap.cs
View file @
44764797
...
...
@@ -2,10 +2,10 @@
* date :2014-02-07
* desc :图像处理,裁剪,缩放,保存
*/
using
System.IO
;
using
System.Drawing
;
using
System.Drawing.Drawing2D
;
using
System.Drawing.Imaging
;
using
System.IO
;
namespace
DataEditorX.Common
{
...
...
@@ -35,7 +35,7 @@ public static Bitmap ReadImage(string file)
/// <returns>处理好的图像</returns>
public
static
Bitmap
Zoom
(
Bitmap
sourceBitmap
,
int
newWidth
,
int
newHeight
)
{
if
(
sourceBitmap
!=
null
)
if
(
sourceBitmap
!=
null
)
{
Bitmap
b
=
new
Bitmap
(
newWidth
,
newHeight
);
Graphics
graphics
=
Graphics
.
FromImage
(
b
);
...
...
@@ -79,17 +79,17 @@ public static Bitmap Cut(Bitmap sourceBitmap, Area area)
/// <returns>处理好的图像</returns>
public
static
Bitmap
Cut
(
Bitmap
sourceBitmap
,
int
StartX
,
int
StartY
,
int
cutWidth
,
int
cutHeight
)
{
if
(
sourceBitmap
!=
null
)
if
(
sourceBitmap
!=
null
)
{
int
w
=
sourceBitmap
.
Width
;
int
h
=
sourceBitmap
.
Height
;
//裁剪的区域宽度调整
if
(
(
StartX
+
cutWidth
)
>
w
)
if
(
(
StartX
+
cutWidth
)
>
w
)
{
cutWidth
=
w
-
StartX
;
}
//裁剪的区域高度调整
if
(
(
StartY
+
cutHeight
)
>
h
)
if
(
(
StartY
+
cutHeight
)
>
h
)
{
cutHeight
=
h
-
StartY
;
}
...
...
@@ -121,12 +121,12 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid
/// <param name="filename">保存路径</param>
/// <param name="quality">质量</param>
/// <returns>是否保存成功</returns>
public
static
bool
SaveAsJPEG
(
Bitmap
bitmap
,
string
filename
,
int
quality
=
90
)
public
static
bool
SaveAsJPEG
(
Bitmap
bitmap
,
string
filename
,
int
quality
=
90
)
{
if
(
bitmap
!=
null
)
if
(
bitmap
!=
null
)
{
string
path
=
Path
.
GetDirectoryName
(
filename
);
if
(!
Directory
.
Exists
(
path
))
//创建文件夹
if
(!
Directory
.
Exists
(
path
))
//创建文件夹
{
Directory
.
CreateDirectory
(
path
);
}
...
...
@@ -138,9 +138,9 @@ public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality=90)
ImageCodecInfo
[]
codecs
=
ImageCodecInfo
.
GetImageEncoders
();
ImageCodecInfo
ici
=
null
;
foreach
(
ImageCodecInfo
codec
in
codecs
)
foreach
(
ImageCodecInfo
codec
in
codecs
)
{
if
(
codec
.
MimeType
.
IndexOf
(
"jpeg"
)
>
-
1
)
if
(
codec
.
MimeType
.
IndexOf
(
"jpeg"
)
>
-
1
)
{
ici
=
codec
;
break
;
...
...
@@ -152,7 +152,7 @@ public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality=90)
}
EncoderParameters
encoderParams
=
new
EncoderParameters
();
encoderParams
.
Param
[
0
]
=
new
EncoderParameter
(
Encoder
.
Quality
,
(
long
)
quality
);
encoderParams
.
Param
[
0
]
=
new
EncoderParameter
(
Encoder
.
Quality
,
quality
);
if
(
ici
!=
null
)
{
bitmap
.
Save
(
filename
,
ici
,
encoderParams
);
...
...
DataEditorX/Common/MyPath.cs
View file @
44764797
...
...
@@ -5,7 +5,6 @@
* 时间: 10:26
*
*/
using
System
;
using
System.Text
;
using
System.Windows.Forms
;
...
...
@@ -84,14 +83,15 @@ public static string Combine(params string[] paths)
/// <param name="dir">目录</param>
/// <param name="defalut">不合法时,采取的目录</param>
/// <returns></returns>
public
static
string
CheckDir
(
string
dir
,
string
defalut
)
public
static
string
CheckDir
(
string
dir
,
string
defalut
)
{
DirectoryInfo
fo
;
try
{
fo
=
new
DirectoryInfo
(
GetRealPath
(
dir
));
}
catch
{
catch
{
//路径不合法
fo
=
new
DirectoryInfo
(
defalut
);
}
...
...
@@ -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
GetFileName
(
string
tag
,
string
lang
)
public
static
string
GetFileName
(
string
tag
,
string
lang
)
{
return
tag
+
"_"
+
lang
+
".txt"
;
}
...
...
DataEditorX/Common/MySortList.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
namespace
DataEditorX
{
...
...
@@ -12,10 +10,10 @@ public int Compare(K x, K y)
}
}
public
class
MySortList
<
K
,
V
>
:
SortedList
<
K
,
V
>
public
class
MySortList
<
K
,
V
>
:
SortedList
<
K
,
V
>
{
public
MySortList
():
base
(
new
MyComparer
<
K
>())
public
MySortList
()
:
base
(
new
MyComparer
<
K
>())
{
}
...
...
@@ -24,11 +22,11 @@ public new void Add(K key, V value)
//falg用于跳出函数
int
flag
=
0
;
//检查是否具备这个key,并且检查value是否重复
foreach
(
KeyValuePair
<
K
,
V
>
item
in
this
)
foreach
(
KeyValuePair
<
K
,
V
>
item
in
this
)
{
if
(
item
.
Key
.
ToString
()
==
key
.
ToString
()
&&
item
.
Value
.
ToString
()
==
value
.
ToString
())
{
flag
=
1
;
flag
=
1
;
}
}
if
(
flag
==
1
)
...
...
DataEditorX/Common/MyUtils.cs
View file @
44764797
...
...
@@ -6,9 +6,8 @@
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using
System
;
using
System.Text
;
using
System.IO
;
using
System.Text
;
namespace
DataEditorX.Common
{
...
...
@@ -45,8 +44,9 @@ public static string GetMD5HashFromFile(string fileName)
return
""
;
}
public
static
bool
Md5isEmpty
(
string
md5
){
return
md5
==
null
||
md5
.
Length
<
16
;
public
static
bool
Md5isEmpty
(
string
md5
)
{
return
md5
==
null
||
md5
.
Length
<
16
;
}
}
}
DataEditorX/Common/StrUtil.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text
;
namespace
DataEditorX.Common
{
...
...
@@ -13,7 +11,7 @@ public static string AutoEnter(string str, int lineNum, char re)
return
""
;
}
str
=
" "
+
str
.
Replace
(
"\r\n"
,
"\n"
);
str
=
" "
+
str
.
Replace
(
"\r\n"
,
"\n"
);
char
[]
ch
=
str
.
ToCharArray
();
_
=
ch
.
Length
;
...
...
@@ -37,7 +35,7 @@ public static string AutoEnter(string str, int lineNum, char re)
sb
.
Append
(
re
);
i
=
0
;
}
else
if
(
c
==
re
)
else
if
(
c
==
re
)
{
sb
.
Append
(
c
);
i
=
0
;
...
...
@@ -47,7 +45,9 @@ public static string AutoEnter(string str, int lineNum, char re)
sb
.
Append
(
c
);
sb
.
Append
(
re
);
i
=
0
;
}
else
{
}
else
{
sb
.
Append
(
c
);
}
}
...
...
DataEditorX/Common/User32.cs
View file @
44764797
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-25
* 时间: 21:30
*
*/
using
System
;
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-25
* 时间: 21:30
*
*/
using
System.Runtime.InteropServices
;
namespace
System
...
...
DataEditorX/Common/XMLReader.cs
View file @
44764797
using
System
;
using
System
.Windows.Forms
;
using
System.Xml
;
using
System.IO
;
using
DataEditorX.Common
;
using
System.Windows.Forms
;
using
System.Diagnostics
;
using
System.Reflection
;
namespace
DataEditorX.Common
{
...
...
DataEditorX/Common/ZipStorer.cs
View file @
44764797
...
...
@@ -15,11 +15,13 @@ public class ZipStorer : IDisposable
/// <summary>
/// Compression method enumeration
/// </summary>
public
enum
Compression
:
ushort
{
public
enum
Compression
:
ushort
{
/// <summary>Uncompressed storage</summary>
Store
=
0
,
/// <summary>Deflate compression method</summary>
Deflate
=
8
}
Deflate
=
8
}
#
region
ZipFileEntry
/// <summary>
...
...
@@ -151,7 +153,7 @@ public static ZipStorer Create(Stream _stream, string _comment)
/// <returns>A valid ZipStorer object</returns>
public
static
ZipStorer
Open
(
string
_filename
,
FileAccess
_access
)
{
Stream
stream
=
(
Stream
)
new
FileStream
(
_filename
,
FileMode
.
Open
,
_access
==
FileAccess
.
Read
?
FileAccess
.
Read
:
FileAccess
.
ReadWrite
);
Stream
stream
=
new
FileStream
(
_filename
,
FileMode
.
Open
,
_access
==
FileAccess
.
Read
?
FileAccess
.
Read
:
FileAccess
.
ReadWrite
);
ZipStorer
zip
=
Open
(
stream
,
_access
);
zip
.
fileName
=
_filename
;
...
...
@@ -237,7 +239,7 @@ public void AddStream(Compression _method, string _filenameInZip, Stream _source
throw
new
InvalidOperationException
(
"Writing is not alowed"
);
}
if
(
this
.
files
.
Count
==
0
)
if
(
this
.
files
.
Count
==
0
)
{
}
else
...
...
@@ -325,7 +327,7 @@ public List<ZipFileEntry> ReadCentralDir()
List
<
ZipFileEntry
>
result
=
new
List
<
ZipFileEntry
>();
for
(
int
pointer
=
0
;
pointer
<
this
.
centralDirImage
.
Length
;
)
for
(
int
pointer
=
0
;
pointer
<
this
.
centralDirImage
.
Length
;)
{
uint
signature
=
BitConverter
.
ToUInt32
(
this
.
centralDirImage
,
pointer
);
if
(
signature
!=
0x02014b50
)
...
...
@@ -561,7 +563,7 @@ private void WriteLocalHeader(ref ZipFileEntry _zfe)
Encoding
encoder
=
_zfe
.
EncodeUTF8
?
Encoding
.
UTF8
:
_defaultEncoding
;
byte
[]
encodedFilename
=
encoder
.
GetBytes
(
_zfe
.
FilenameInZip
);
this
.
zipFileStream
.
Write
(
new
byte
[]
{
80
,
75
,
3
,
4
,
20
,
0
},
0
,
6
);
// No extra header
this
.
zipFileStream
.
Write
(
new
byte
[]
{
80
,
75
,
3
,
4
,
20
,
0
},
0
,
6
);
// No extra header
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)(
_zfe
.
EncodeUTF8
?
0x0800
:
0
)),
0
,
2
);
// filename and comment encoding
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
_zfe
.
Method
),
0
,
2
);
// zipping method
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
(
this
.
DateTimeToDosTime
(
_zfe
.
ModifyTime
)),
0
,
4
);
// zipping date and time
...
...
@@ -643,8 +645,8 @@ private void WriteEndRecord(uint _size, uint _offset)
byte
[]
encodedComment
=
encoder
.
GetBytes
(
this
.
comment
);
this
.
zipFileStream
.
Write
(
new
byte
[]
{
80
,
75
,
5
,
6
,
0
,
0
,
0
,
0
},
0
,
8
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
this
.
files
.
Count
+
this
.
existingFiles
),
0
,
2
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
this
.
files
.
Count
+
this
.
existingFiles
),
0
,
2
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
this
.
files
.
Count
+
this
.
existingFiles
),
0
,
2
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
this
.
files
.
Count
+
this
.
existingFiles
),
0
,
2
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
(
_size
),
0
,
4
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
(
_offset
),
0
,
4
);
this
.
zipFileStream
.
Write
(
BitConverter
.
GetBytes
((
ushort
)
encodedComment
.
Length
),
0
,
2
);
...
...
@@ -722,7 +724,7 @@ private uint DateTimeToDosTime(DateTime _dt)
{
return
(
uint
)(
(
_dt
.
Second
/
2
)
|
(
_dt
.
Minute
<<
5
)
|
(
_dt
.
Hour
<<
11
)
|
(
_dt
.
Day
<<
16
)
|
(
_dt
.
Month
<<
21
)
|
((
_dt
.
Year
-
1980
)
<<
25
));
(
_dt
.
Day
<<
16
)
|
(
_dt
.
Month
<<
21
)
|
((
_dt
.
Year
-
1980
)
<<
25
));
}
private
DateTime
DosTimeToDateTime
(
uint
_dt
)
{
...
...
DataEditorX/Config/CodeConfig.cs
View file @
44764797
using
System
;
using
FastColoredTextBoxNS
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
FastColoredTextBoxNS
;
namespace
DataEditorX.Config
{
/// <summary>
...
...
@@ -209,7 +208,7 @@ void AddToolIipDic(string key, string val)
nval
+=
Environment
.
NewLine
;
}
nval
+=
Environment
.
NewLine
+
val
;
nval
+=
Environment
.
NewLine
+
val
;
this
.
tooltipDic
[
skey
]
=
nval
;
}
else
...
...
DataEditorX/Config/DataConfig.cs
View file @
44764797
...
...
@@ -18,7 +18,7 @@ public class DataConfig
{
public
DataConfig
()
{
this
.
InitMember
(
MyPath
.
Combine
(
Application
.
StartupPath
,
MyConfig
.
TAG_CARDINFO
+
".txt"
));
this
.
InitMember
(
MyPath
.
Combine
(
Application
.
StartupPath
,
MyConfig
.
TAG_CARDINFO
+
".txt"
));
}
public
DataConfig
(
string
conf
)
{
...
...
@@ -31,7 +31,7 @@ public DataConfig(string conf)
public
void
InitMember
(
string
conf
)
{
//conf = MyPath.Combine(datapath, MyConfig.FILE_INFO);
if
(!
File
.
Exists
(
conf
))
if
(!
File
.
Exists
(
conf
))
{
this
.
dicCardRules
=
new
Dictionary
<
long
,
string
>();
this
.
dicSetnames
=
new
Dictionary
<
long
,
string
>();
...
...
DataEditorX/Config/DataManager.cs
View file @
44764797
...
...
@@ -6,11 +6,11 @@
*
*/
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Globalization
;
using
System.Collections.Generic
;
namespace
DataEditorX.Config
{
...
...
@@ -42,7 +42,7 @@ public static string SubString(string content, string tag)
Match
mac
=
reg
.
Match
(
reReturn
(
content
));
if
(
mac
.
Success
)
//把相应的内容提取出来
{
return
mac
.
Groups
[
1
].
Value
.
Replace
(
"\n"
,
Environment
.
NewLine
);
return
mac
.
Groups
[
1
].
Value
.
Replace
(
"\n"
,
Environment
.
NewLine
);
}
return
""
;
}
...
...
@@ -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
(
SubString
(
content
,
tag
));
return
Read
(
SubString
(
content
,
tag
));
}
/// <summary>
/// 从文件读取内容,按行读取
...
...
@@ -150,7 +150,7 @@ public static string[] GetValues(Dictionary<long, string> dic)
/// <returns></returns>
public
static
string
GetValue
(
Dictionary
<
long
,
string
>
dic
,
long
key
)
{
if
(
dic
.
ContainsKey
(
key
))
if
(
dic
.
ContainsKey
(
key
))
{
return
dic
[
key
].
Trim
();
}
...
...
DataEditorX/Config/ImageSet.cs
View file @
44764797
...
...
@@ -5,9 +5,6 @@
* 时间: 9:02
*
*/
using
System
;
using
System.Configuration
;
using
DataEditorX.Config
;
using
DataEditorX.Common
;
namespace
DataEditorX.Config
...
...
@@ -17,7 +14,8 @@ namespace DataEditorX.Config
/// </summary>
public
class
ImageSet
{
public
ImageSet
(){
public
ImageSet
()
{
this
.
Init
();
}
//初始化
...
...
DataEditorX/Config/MyConfig.cs
View file @
44764797
using
System
;
using
System.Xml
;
using
System.IO
;
using
System.Globalization
;
using
DataEditorX.Common
;
using
System.Windows.Forms
;
using
DataEditorX.Common
;
using
System
;
using
System.Diagnostics
;
using
System.Globalization
;
using
System.IO
;
using
System.Reflection
;
using
System.Windows.Forms
;
namespace
DataEditorX.Config
{
...
...
@@ -259,13 +258,15 @@ public static Area ReadArea(string key)
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public
static
bool
ReadBoolean
(
string
key
,
bool
def
=
false
)
public
static
bool
ReadBoolean
(
string
key
,
bool
def
=
false
)
{
string
val
=
ReadString
(
key
);
if
(
"true"
.
Equals
(
val
,
StringComparison
.
OrdinalIgnoreCase
)){
if
(
"true"
.
Equals
(
val
,
StringComparison
.
OrdinalIgnoreCase
))
{
return
true
;
}
if
(
"false"
.
Equals
(
val
,
StringComparison
.
OrdinalIgnoreCase
)){
if
(
"false"
.
Equals
(
val
,
StringComparison
.
OrdinalIgnoreCase
))
{
return
false
;
}
return
def
;
...
...
DataEditorX/Config/YgoPath.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.IO
;
using
System.IO
;
namespace
DataEditorX.Config
{
...
...
@@ -67,7 +64,7 @@ public string GetImage(string id)
//}
public
string
GetImageField
(
string
id
)
{
return
MyPath
.
Combine
(
this
.
fieldpath
,
id
+
".png"
);
//场地图
return
MyPath
.
Combine
(
this
.
fieldpath
,
id
+
".png"
);
//场地图
}
public
string
GetScript
(
string
id
)
{
...
...
DataEditorX/Controls/DFlowLayoutPanel.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
namespace
DataEditorX
{
...
...
DataEditorX/Controls/DListBox.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
namespace
DataEditorX
{
...
...
DataEditorX/Controls/DListView.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
namespace
DataEditorX
{
...
...
DataEditorX/Controls/FastColoredTextBoxEx.cs
View file @
44764797
...
...
@@ -7,10 +7,7 @@
*/
using
System
;
using
System.Drawing
;
using
System.Drawing.Drawing2D
;
using
System.Windows.Forms
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
FastColoredTextBoxNS
{
...
...
@@ -53,8 +50,8 @@ protected override void OnToolTip()
//check distance
Point
p
=
this
.
PlaceToPoint
(
place
);
if
(
Math
.
Abs
(
p
.
X
-
this
.
lastMouseCoord
.
X
)
>
this
.
CharWidth
*
2
||
Math
.
Abs
(
p
.
Y
-
this
.
lastMouseCoord
.
Y
)
>
this
.
CharHeight
*
2
)
if
(
Math
.
Abs
(
p
.
X
-
this
.
lastMouseCoord
.
X
)
>
this
.
CharWidth
*
2
||
Math
.
Abs
(
p
.
Y
-
this
.
lastMouseCoord
.
Y
)
>
this
.
CharHeight
*
2
)
{
return
;
}
...
...
@@ -73,14 +70,14 @@ protected override void OnToolTip()
public
void
ShowTooltipWithLabel
(
string
title
,
string
text
,
int
height
)
{
lbTooltip
.
Visible
=
true
;
lbTooltip
.
Text
=
$"
{
title
}
\r\n\r\n
{
text
}
"
;
lbTooltip
.
Location
=
new
Point
(
this
.
Size
.
Width
-
500
,
height
);
this
.
lbTooltip
.
Visible
=
true
;
this
.
lbTooltip
.
Text
=
$"
{
title
}
\r\n\r\n
{
text
}
"
;
this
.
lbTooltip
.
Location
=
new
Point
(
this
.
Size
.
Width
-
500
,
height
);
}
public
void
ShowTooltipWithLabel
(
string
title
,
string
text
)
{
this
.
ShowTooltipWithLabel
(
title
,
text
,
this
.
lastMouseCoord
.
Y
+
this
.
CharHeight
);
this
.
ShowTooltipWithLabel
(
title
,
text
,
this
.
lastMouseCoord
.
Y
+
this
.
CharHeight
);
}
//高亮当前词
...
...
@@ -127,7 +124,7 @@ private void InitializeComponent()
//
this
.
lbTooltip
.
AutoSize
=
true
;
this
.
lbTooltip
.
BackColor
=
SystemColors
.
Desktop
;
this
.
lbTooltip
.
Font
=
new
Font
(
"微软雅黑"
,
15.75F
,
FontStyle
.
Regular
,
GraphicsUnit
.
Point
,
((
byte
)(
0
))
);
this
.
lbTooltip
.
Font
=
new
Font
(
"微软雅黑"
,
15.75F
,
FontStyle
.
Regular
,
GraphicsUnit
.
Point
,
0
);
this
.
lbTooltip
.
ForeColor
=
SystemColors
.
Control
;
this
.
lbTooltip
.
Location
=
new
Point
(
221
,
117
);
this
.
lbTooltip
.
MaximumSize
=
new
Size
(
480
,
0
);
...
...
@@ -157,7 +154,7 @@ private void FastColoredTextBoxEx_Load(object sender, EventArgs e)
private
void
lbTooltip_MouseMove
(
object
sender
,
MouseEventArgs
e
)
{
lbTooltip
.
Visible
=
false
;
this
.
lbTooltip
.
Visible
=
false
;
}
}
}
DataEditorX/Controls/History.cs
View file @
44764797
using
System
;
using
DataEditorX.Config
;
using
DataEditorX.Core
;
using
DataEditorX.Language
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
DataEditorX.Core
;
using
DataEditorX.Config
;
using
System.Windows.Forms
;
using
DataEditorX.Language
;
namespace
DataEditorX.Controls
{
...
...
@@ -108,7 +108,7 @@ void SaveHistory()
texts
+=
Environment
.
NewLine
+
str
;
}
}
if
(
File
.
Exists
(
this
.
historyFile
))
if
(
File
.
Exists
(
this
.
historyFile
))
{
File
.
Delete
(
this
.
historyFile
);
}
...
...
DataEditorX/Controls/IEditForm.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DataEditorX.Controls
namespace
DataEditorX.Controls
{
public
interface
IEditForm
{
...
...
DataEditorX/Controls/MySyntaxHighlighter.cs
View file @
44764797
...
...
@@ -5,13 +5,7 @@
* 时间: 23:14
*
*/
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Globalization
;
using
System.IO
;
using
System.Text.RegularExpressions
;
using
System.Xml
;
namespace
FastColoredTextBoxNS
{
...
...
@@ -47,23 +41,23 @@ public override void LuaSyntaxHighlight(Range range)
//clear style of changed range
range
.
ClearStyle
(
this
.
mStrStyle
,
this
.
mGrayStyle
,
this
.
conStyle
,
this
.
mNumberStyle
,
this
.
mKeywordStyle
,
this
.
mFunStyle
);
//
if
(
LuaStringRegex
==
null
)
if
(
this
.
LuaStringRegex
==
null
)
{
InitLuaRegex
();
this
.
InitLuaRegex
();
}
//string highlighting
range
.
SetStyle
(
this
.
mStrStyle
,
LuaStringRegex
);
range
.
SetStyle
(
this
.
mStrStyle
,
this
.
LuaStringRegex
);
//comment highlighting
range
.
SetStyle
(
this
.
mGrayStyle
,
LuaCommentRegex1
);
range
.
SetStyle
(
this
.
mGrayStyle
,
LuaCommentRegex2
);
range
.
SetStyle
(
this
.
mGrayStyle
,
LuaCommentRegex3
);
range
.
SetStyle
(
this
.
mGrayStyle
,
this
.
LuaCommentRegex1
);
range
.
SetStyle
(
this
.
mGrayStyle
,
this
.
LuaCommentRegex2
);
range
.
SetStyle
(
this
.
mGrayStyle
,
this
.
LuaCommentRegex3
);
//number highlighting
range
.
SetStyle
(
this
.
mNumberStyle
,
LuaNumberRegex
);
range
.
SetStyle
(
this
.
mNumberStyle
,
this
.
LuaNumberRegex
);
//keyword highlighting
range
.
SetStyle
(
this
.
mKeywordStyle
,
LuaKeywordRegex
);
range
.
SetStyle
(
this
.
mKeywordStyle
,
this
.
LuaKeywordRegex
);
//functions highlighting
range
.
SetStyle
(
this
.
mFunStyle
,
LuaFunctionsRegex
);
range
.
SetStyle
(
this
.
mFunStyle
,
this
.
LuaFunctionsRegex
);
range
.
SetStyle
(
this
.
mNumberStyle
,
@"\bc\d+\b"
);
range
.
SetStyle
(
this
.
conStyle
,
@"[\s|\(|+|,]{0,1}(?<range>[A-Z_]+?)[\)|+|\s|,|;]"
);
...
...
DataEditorX/Core/Card.cs
View file @
44764797
...
...
@@ -3,10 +3,10 @@
* desc :卡片类
* ModiftyDate :2014-02-12
*/
using
DataEditorX.Core.Info
;
using
System
;
using
System.Globalization
;
using
System.Text.RegularExpressions
;
using
DataEditorX.Core.Info
;
namespace
DataEditorX.Core
{
...
...
@@ -75,7 +75,8 @@ public Card(long cardCode)
/// <summary>脚本文件文字</summary>
public
string
[]
Str
{
get
{
get
{
if
(
this
.
str
==
null
)
{
this
.
str
=
new
string
[
STR_MAX
];
...
...
@@ -91,7 +92,7 @@ public string[] Str
public
long
[]
GetSetCode
()
{
long
[]
setcodes
=
new
long
[
SETCODE_MAX
];
for
(
int
i
=
0
,
k
=
0
;
i
<
SETCODE_MAX
;
k
+=
0x10
,
i
++)
for
(
int
i
=
0
,
k
=
0
;
i
<
SETCODE_MAX
;
k
+=
0x10
,
i
++)
{
setcodes
[
i
]
=
(
this
.
setcode
>>
k
)
&
0xffff
;
}
...
...
@@ -222,7 +223,7 @@ public bool EqualsData(Card other)
public
bool
Equals
(
Card
other
)
{
bool
equalBool
=
this
.
EqualsData
(
other
);
if
(!
equalBool
)
if
(!
equalBool
)
{
return
false
;
}
...
...
@@ -266,8 +267,9 @@ public override int GetHashCode()
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public
bool
IsType
(
CardType
type
){
if
((
this
.
type
&
(
long
)
type
)
==
(
long
)
type
)
public
bool
IsType
(
CardType
type
)
{
if
((
this
.
type
&
(
long
)
type
)
==
(
long
)
type
)
{
return
true
;
}
...
...
@@ -318,22 +320,26 @@ public string IdString
public
override
string
ToString
()
{
string
str
;
if
(
this
.
IsType
(
CardType
.
TYPE_MONSTER
)){
if
(
this
.
IsType
(
CardType
.
TYPE_MONSTER
))
{
str
=
this
.
name
+
"["
+
this
.
IdString
+
"]\n["
+
YGOUtil
.
GetTypeString
(
this
.
type
)
+
"] "
+
YGOUtil
.
GetRace
(
this
.
race
)
+
"/"
+
YGOUtil
.
GetAttributeString
(
this
.
attribute
)
+
"\n"
+
this
.
levelString
()
+
" "
+
this
.
atk
+
"/"
+
this
.
def
+
"\n"
+
this
.
redesc
();
}
else
}
else
{
str
=
this
.
name
+
"["
+
this
.
IdString
+
"]\n["
+
YGOUtil
.
GetTypeString
(
this
.
type
)+
"]\n"
+
this
.
redesc
();
str
=
this
.
name
+
"["
+
this
.
IdString
+
"]\n["
+
YGOUtil
.
GetTypeString
(
this
.
type
)
+
"]\n"
+
this
.
redesc
();
}
return
str
;
}
public
string
ToShortString
(){
return
this
.
name
+
" ["
+
this
.
IdString
+
"]"
;
public
string
ToShortString
()
{
return
this
.
name
+
" ["
+
this
.
IdString
+
"]"
;
}
public
string
ToLongString
(){
public
string
ToLongString
()
{
return
this
.
ToString
();
}
...
...
DataEditorX/Core/CardEdit.cs
View file @
44764797
using
System
;
using
DataEditorX.Config
;
using
DataEditorX.Language
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.IO
;
using
DataEditorX.Config
;
using
DataEditorX.Language
;
using
DataEditorX.Core.Info
;
using
System.Text
;
namespace
DataEditorX.Core
{
...
...
@@ -27,7 +25,7 @@ public CardEdit(IDataForm dataform)
#
region
添加
//添加
public
class
AddCommand
:
IBackableCommand
public
class
AddCommand
:
IBackableCommand
{
private
string
undoSQL
;
readonly
IDataForm
dataform
;
...
...
@@ -84,7 +82,7 @@ public object Clone()
#
region
修改
//修改
public
class
ModCommand
:
IBackableCommand
public
class
ModCommand
:
IBackableCommand
{
private
string
undoSQL
;
private
bool
modifiled
=
false
;
...
...
@@ -283,11 +281,16 @@ public bool OpenScript(bool openinthis, string addrequire)
Card
c
=
this
.
dataform
.
GetCard
();
long
id
=
c
.
id
;
string
lua
;
if
(
c
.
id
>
0
)
{
if
(
c
.
id
>
0
)
{
lua
=
this
.
dataform
.
GetPath
().
GetScript
(
id
);
}
else
if
(
addrequire
.
Length
>
0
)
{
}
else
if
(
addrequire
.
Length
>
0
)
{
lua
=
this
.
dataform
.
GetPath
().
GetModuleScript
(
addrequire
);
}
else
{
}
else
{
return
false
;
}
if
(!
File
.
Exists
(
lua
))
...
...
@@ -296,7 +299,7 @@ public bool OpenScript(bool openinthis, string addrequire)
if
(
MyMsg
.
Question
(
LMSG
.
IfCreateScript
))
//是否创建脚本
{
using
(
FileStream
fs
=
new
FileStream
(
lua
,
FileMode
.
OpenOrCreate
,
FileAccess
.
Write
))
FileMode
.
OpenOrCreate
,
FileAccess
.
Write
))
{
StreamWriter
sw
=
new
StreamWriter
(
fs
,
new
UTF8Encoding
(
false
));
if
(
string
.
IsNullOrEmpty
(
addrequire
))
...
...
DataEditorX/Core/CommandManager.cs
View file @
44764797
...
...
@@ -46,7 +46,7 @@ private void CommandManager_ReverseUndoStateChanged(bool val)
#
region
ICommandManager
成员
public
void
ExcuteCommand
(
ICommand
command
,
params
object
[]
args
)
{
if
(!
command
.
Excute
(
args
))
if
(!
command
.
Excute
(
args
))
{
return
;
}
...
...
DataEditorX/Core/DataBase.cs
View file @
44764797
This diff is collapsed.
Click to expand it.
DataEditorX/Core/Info/CardAttribute.cs
View file @
44764797
...
...
@@ -5,7 +5,6 @@
* 时间: 9:47
*
*/
using
System
;
namespace
DataEditorX.Core.Info
{
...
...
DataEditorX/Core/Info/CardLink.cs
View file @
44764797
...
...
@@ -6,7 +6,6 @@
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using
System
;
namespace
DataEditorX.Core.Info
{
...
...
@@ -30,7 +29,8 @@ public static class CardLink
public
const
int
Up
=
0x80
;
public
const
int
UpRight
=
0x100
;
public
static
bool
IsLink
(
int
marks
,
int
mark
){
public
static
bool
IsLink
(
int
marks
,
int
mark
)
{
return
(
marks
&
mark
)
==
mark
;
}
}
...
...
DataEditorX/Core/Info/CardRace.cs
View file @
44764797
...
...
@@ -5,7 +5,6 @@
* 时间: 9:44
*
*/
using
System
;
namespace
DataEditorX.Core.Info
{
...
...
DataEditorX/Core/Info/CardRule.cs
View file @
44764797
namespace
DataEditorX.Core.Info
{
public
enum
CardRule
:
int
public
enum
CardRule
:
int
{
/// <summary>无</summary>
NONE
=
0
,
...
...
DataEditorX/Core/Info/CardType.cs
View file @
44764797
...
...
@@ -5,7 +5,6 @@
* 时间: 9:08
*
*/
using
System
;
using
System.Collections.Generic
;
namespace
DataEditorX.Core.Info
...
...
@@ -16,61 +15,62 @@ namespace DataEditorX.Core.Info
public
enum
CardType
:
long
{
///<summary>怪兽卡</summary>
TYPE_MONSTER
=
0x1
,
TYPE_MONSTER
=
0x1
,
///<summary>魔法卡</summary>
TYPE_SPELL
=
0x2
,
TYPE_SPELL
=
0x2
,
///<summary>陷阱卡</summary>
TYPE_TRAP
=
0x4
,
TYPE_TRAP
=
0x4
,
///<summary>通常</summary>
TYPE_NORMAL
=
0x10
,
TYPE_NORMAL
=
0x10
,
///<summary>效果</summary>
TYPE_EFFECT
=
0x20
,
TYPE_EFFECT
=
0x20
,
///<summary>融合</summary>
TYPE_FUSION
=
0x40
,
TYPE_FUSION
=
0x40
,
///<summary>仪式</summary>
TYPE_RITUAL
=
0x80
,
TYPE_RITUAL
=
0x80
,
///<summary>陷阱怪兽</summary>
TYPE_TRAPMONSTER
=
0x100
,
TYPE_TRAPMONSTER
=
0x100
,
///<summary>灵魂</summary>
TYPE_SPIRIT
=
0x200
,
TYPE_SPIRIT
=
0x200
,
///<summary>同盟</summary>
TYPE_UNION
=
0x400
,
TYPE_UNION
=
0x400
,
///<summary>二重</summary>
TYPE_DUAL
=
0x800
,
TYPE_DUAL
=
0x800
,
///<summary>调整</summary>
TYPE_TUNER
=
0x1000
,
TYPE_TUNER
=
0x1000
,
///<summary>同调</summary>
TYPE_SYNCHRO
=
0x2000
,
TYPE_SYNCHRO
=
0x2000
,
///<summary>衍生物</summary>
TYPE_TOKEN
=
0x4000
,
TYPE_TOKEN
=
0x4000
,
///<summary>速攻</summary>
TYPE_QUICKPLAY
=
0x10000
,
TYPE_QUICKPLAY
=
0x10000
,
///<summary>永续</summary>
TYPE_CONTINUOUS
=
0x20000
,
TYPE_CONTINUOUS
=
0x20000
,
///<summary>装备</summary>
TYPE_EQUIP
=
0x40000
,
TYPE_EQUIP
=
0x40000
,
///<summary>场地</summary>
TYPE_FIELD
=
0x80000
,
TYPE_FIELD
=
0x80000
,
///<summary>反击</summary>
TYPE_COUNTER
=
0x100000
,
TYPE_COUNTER
=
0x100000
,
///<summary>反转</summary>
TYPE_FLIP
=
0x200000
,
TYPE_FLIP
=
0x200000
,
///<summary>卡通</summary>
TYPE_TOON
=
0x400000
,
TYPE_TOON
=
0x400000
,
///<summary>超量</summary>
TYPE_XYZ
=
0x800000
,
TYPE_XYZ
=
0x800000
,
///<summary>灵摆</summary>
TYPE_PENDULUM
=
0x1000000
,
TYPE_PENDULUM
=
0x1000000
,
///<summary>特殊召唤</summary>
TYPE_SPSUMMON
=
0x2000000
,
TYPE_SPSUMMON
=
0x2000000
,
///<summary>连接</summary>
TYPE_LINK
=
0x4000000
,
TYPE_LINK
=
0x4000000
,
}
public
static
class
CardTypes
{
public
static
class
CardTypes
{
public
static
readonly
CardType
[]
TYPE1
=
{
CardType
.
TYPE_TOKEN
,
CardType
.
TYPE_LINK
,
...
...
@@ -157,16 +157,20 @@ public static class CardTypes{
CardType
.
TYPE_EFFECT
,
CardType
.
TYPE_NORMAL
,
};
public
static
CardType
[]
GetMonsterTypes
(
long
type
,
bool
no10
=
false
){
public
static
CardType
[]
GetMonsterTypes
(
long
type
,
bool
no10
=
false
)
{
var
list
=
new
List
<
CardType
>(
5
);
var
typeList
=
new
List
<
CardType
[
]>
(
5
);
if
(
no10
){
if
(
no10
)
{
typeList
.
Add
(
TYPE1_10
);
typeList
.
Add
(
TYPE2_10
);
typeList
.
Add
(
TYPE3_10
);
typeList
.
Add
(
TYPE4_10
);
typeList
.
Add
(
TYPE4_10
);
}
else
{
}
else
{
typeList
.
Add
(
TYPE1
);
typeList
.
Add
(
TYPE2
);
typeList
.
Add
(
TYPE3
);
...
...
@@ -175,11 +179,15 @@ public static class CardTypes{
}
int
count
=
typeList
.
Count
;
for
(
int
i
=
0
;
i
<
count
;
i
++){
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
CardType
[]
types
=
typeList
[
i
];
foreach
(
var
t
in
types
){
if
((
type
&
(
long
)
t
)==(
long
)
t
){
if
(!
list
.
Contains
(
t
)){
foreach
(
var
t
in
types
)
{
if
((
type
&
(
long
)
t
)
==
(
long
)
t
)
{
if
(!
list
.
Contains
(
t
))
{
list
.
Add
(
t
);
break
;
}
...
...
DataEditorX/Core/LuaFunction.cs
View file @
44764797
This diff is collapsed.
Click to expand it.
DataEditorX/Core/Mse/CardPack.cs
View file @
44764797
...
...
@@ -6,7 +6,6 @@
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using
System
;
namespace
DataEditorX.Core
{
...
...
@@ -17,10 +16,11 @@ public class CardPack
{
public
CardPack
(
long
id
)
{
this
.
CardId
=
id
;
this
.
CardId
=
id
;
}
public
long
CardId
{
public
long
CardId
{
get
;
private
set
;
}
...
...
@@ -29,69 +29,72 @@ public CardPack(long id)
public
string
rarity
;
public
string
date
;
public
string
GetMseRarity
(){
if
(
this
.
rarity
==
null
)
public
string
GetMseRarity
()
{
if
(
this
.
rarity
==
null
)
{
return
"common"
;
}
string
rarity
=
this
.
rarity
.
Trim
().
ToLower
();
if
(
rarity
.
Equals
(
"common"
)
||
rarity
.
Equals
(
"short print"
))
if
(
rarity
.
Equals
(
"common"
)
||
rarity
.
Equals
(
"short print"
))
{
return
"common"
;
}
if
(
rarity
.
Equals
(
"rare"
)
||
rarity
.
Equals
(
"normal rare"
))
if
(
rarity
.
Equals
(
"rare"
)
||
rarity
.
Equals
(
"normal rare"
))
{
return
"rare"
;
}
else
if
(
rarity
.
Contains
(
"parallel"
)
||
rarity
.
Contains
(
"Kaiba"
)
||
rarity
.
Contains
(
"duel terminal"
))
}
else
if
(
rarity
.
Contains
(
"parallel"
)
||
rarity
.
Contains
(
"Kaiba"
)
||
rarity
.
Contains
(
"duel terminal"
))
{
return
"parallel rare"
;
}
else
if
(
rarity
.
Contains
(
"super"
)
||
rarity
.
Contains
(
"holofoil"
))
else
if
(
rarity
.
Contains
(
"super"
)
||
rarity
.
Contains
(
"holofoil"
))
{
return
"super rare"
;
}
else
if
(
rarity
.
Contains
(
"ultra"
))
else
if
(
rarity
.
Contains
(
"ultra"
))
{
return
"ultra rare"
;
}
else
if
(
rarity
.
Contains
(
"secret"
))
else
if
(
rarity
.
Contains
(
"secret"
))
{
return
"secret rare"
;
}
else
if
(
rarity
.
Contains
(
"gold"
))
else
if
(
rarity
.
Contains
(
"gold"
))
{
return
"gold rare"
;
}
else
if
(
rarity
.
Contains
(
"ultimate"
))
else
if
(
rarity
.
Contains
(
"ultimate"
))
{
return
"ultimate rare"
;
}
else
if
(
rarity
.
Contains
(
"prismatic"
))
else
if
(
rarity
.
Contains
(
"prismatic"
))
{
return
"prismatic rare"
;
}
else
if
(
rarity
.
Contains
(
"star"
))
else
if
(
rarity
.
Contains
(
"star"
))
{
return
"star rare"
;
}
else
if
(
rarity
.
Contains
(
"mosaic"
))
else
if
(
rarity
.
Contains
(
"mosaic"
))
{
return
"mosaic rare"
;
}
else
if
(
rarity
.
Contains
(
"platinum"
))
else
if
(
rarity
.
Contains
(
"platinum"
))
{
return
"platinum rare"
;
}
else
if
(
rarity
.
Contains
(
"ghost"
)
||
rarity
.
Contains
(
"holographic"
))
else
if
(
rarity
.
Contains
(
"ghost"
)
||
rarity
.
Contains
(
"holographic"
))
{
return
"ghost rare"
;
}
else
if
(
rarity
.
Contains
(
"millenium"
))
else
if
(
rarity
.
Contains
(
"millenium"
))
{
return
"millenium rare"
;
}
if
(
this
.
rarity
.
Contains
(
"/"
)){
if
(
this
.
rarity
.
Contains
(
"/"
))
{
return
this
.
rarity
.
Split
(
'/'
)[
0
];
}
return
this
.
rarity
;
...
...
DataEditorX/Core/Mse/MSEConfig.cs
View file @
44764797
...
...
@@ -5,15 +5,11 @@
* 时间: 15:47
*
*/
using
System
;
using
System.Configuration
;
using
DataEditorX.Common
;
using
DataEditorX.Config
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text
;
using
DataEditorX.Language
;
using
System.Globalization
;
using
DataEditorX.Common
;
using
DataEditorX.Config
;
namespace
DataEditorX.Core.Mse
{
...
...
@@ -125,26 +121,34 @@ public void SetConfig(string config, string path)
{
this
.
maxcount
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_WIDTH
)){
this
.
width
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
else
if
(
line
.
StartsWith
(
TAG_WIDTH
))
{
this
.
width
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_HEIGHT
)){
this
.
height
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
else
if
(
line
.
StartsWith
(
TAG_HEIGHT
))
{
this
.
height
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_PEND_WIDTH
)){
this
.
pwidth
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
else
if
(
line
.
StartsWith
(
TAG_PEND_WIDTH
))
{
this
.
pwidth
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_PEND_HEIGHT
)){
this
.
pheight
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
else
if
(
line
.
StartsWith
(
TAG_PEND_HEIGHT
))
{
this
.
pheight
=
ConfHelper
.
GetIntegerValue
(
line
,
0
);
}
else
if
(
line
.
StartsWith
(
TAG_NO_TEN
)){
else
if
(
line
.
StartsWith
(
TAG_NO_TEN
))
{
this
.
no10
=
ConfHelper
.
GetBooleanValue
(
line
);
}
else
if
(
line
.
StartsWith
(
TAG_NO_START_CARDS
)){
}
else
if
(
line
.
StartsWith
(
TAG_NO_START_CARDS
))
{
string
val
=
ConfHelper
.
GetValue
(
line
);
string
[]
cs
=
val
.
Split
(
','
);
this
.
noStartCards
=
new
long
[
cs
.
Length
];
this
.
noStartCards
=
new
long
[
cs
.
Length
];
int
i
=
0
;
foreach
(
string
str
in
cs
){
foreach
(
string
str
in
cs
)
{
long
.
TryParse
(
str
,
out
long
l
);
this
.
noStartCards
[
i
++]
=
l
;
}
...
...
@@ -174,7 +178,9 @@ public void SetConfig(string config, string path)
else
if
(
line
.
StartsWith
(
TAG_TYPE
))
{
//类型
ConfHelper
.
DicAdd
(
this
.
typeDic
,
line
);
}
else
if
(
line
.
StartsWith
(
TAG_REIMAGE
)){
}
else
if
(
line
.
StartsWith
(
TAG_REIMAGE
))
{
this
.
reimage
=
ConfHelper
.
GetBooleanValue
(
line
);
}
}
...
...
@@ -189,7 +195,7 @@ public void Init(string path)
if
(!
File
.
Exists
(
tmp
))
{
tmp
=
MyPath
.
Combine
(
path
,
MyPath
.
GetFileName
(
TAG
,
FILE_CONFIG_NAME
));
if
(!
File
.
Exists
(
tmp
))
if
(!
File
.
Exists
(
tmp
))
{
return
;
//如果默认的也不存在
}
...
...
DataEditorX/Core/Mse/MSECons.cs
View file @
44764797
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DataEditorX.Core.Mse
namespace
DataEditorX.Core.Mse
{
public
class
MseAttribute
{
...
...
DataEditorX/Core/Mse/MseMaker.cs
View file @
44764797
This diff is collapsed.
Click to expand it.
DataEditorX/Core/TCGEditor/CardSet.cs
View file @
44764797
using
Newtonsoft.Json
;
using
System
;
using
System.IO
;
using
Newtonsoft.Json
;
namespace
DataEditorX
{
public
class
CardSet
{
public
class
CardSet
{
public
int
game
;
public
int
version
;
public
MySortList
<
string
,
CardInfo
>
cards
;
}
public
class
CardInfo
{
public
class
CardInfo
{
public
string
title
;
public
string
artwork
;
public
int
[]
artwork_crop
;
...
...
@@ -47,13 +49,17 @@ public override string ToString()
}
}
public
class
CardJson
{
public
static
void
Test
(){
public
class
CardJson
{
public
static
void
Test
()
{
string
json
=
File
.
ReadAllText
(
@"F:\TCGEditor_v1.2\t.tcgb"
);
CardSet
cardset
=
JsonConvert
.
DeserializeObject
<
CardSet
>(
json
);
if
(
cardset
.
cards
!=
null
){
if
(
cardset
.
cards
!=
null
)
{
int
index
=
0
;
foreach
(
string
key
in
cardset
.
cards
.
Keys
){
foreach
(
string
key
in
cardset
.
cards
.
Keys
)
{
Console
.
WriteLine
(
key
);
CardInfo
card
=
cardset
.
cards
.
Values
[
index
];
Console
.
WriteLine
(
card
);
...
...
DataEditorX/Core/TaskHelper.cs
View file @
44764797
...
...
@@ -5,22 +5,17 @@
* 时间: 19:43
*
*/
using
System
;
using
DataEditorX.Common
;
using
DataEditorX.Config
;
using
DataEditorX.Core.Info
;
using
DataEditorX.Core.Mse
;
using
DataEditorX.Language
;
using
System.Collections.Generic
;
using
System.Co
nfiguration
;
using
System.Co
mponentModel
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.IO.Compression
;
using
System.Windows.Forms
;
using
System.ComponentModel
;
using
DataEditorX.Language
;
using
DataEditorX.Common
;
using
DataEditorX.Config
;
using
DataEditorX.Core.Mse
;
using
DataEditorX.Core.Info
;
using
System.Xml
;
namespace
DataEditorX.Core
{
...
...
@@ -103,7 +98,8 @@ public MyTask GetLastTask()
return
this
.
lastTask
;
}
public
void
TestPendulumText
(
string
desc
){
public
void
TestPendulumText
(
string
desc
)
{
this
.
mseHelper
.
TestPendulum
(
desc
);
}
#
endregion
...
...
@@ -281,23 +277,23 @@ public string MSEImagePath
public
string
Datapath
{
get
;
}
public
void
SaveMSEs
(
string
file
,
Card
[]
cards
,
bool
isUpdate
)
public
void
SaveMSEs
(
string
file
,
Card
[]
cards
,
bool
isUpdate
)
{
if
(
cards
==
null
)
if
(
cards
==
null
)
{
return
;
}
string
pack_db
=
MyPath
.
GetRealPath
(
MyConfig
.
ReadString
(
"pack_db"
));
bool
rarity
=
MyConfig
.
ReadBoolean
(
"mse_auto_rarity"
,
false
);
#
if
DEBUG
MessageBox
.
Show
(
"db = "
+
pack_db
+
",auto rarity="
+
rarity
);
#
endif
#if DEBUG
MessageBox
.
Show
(
"db = "
+
pack_db
+
",auto rarity="
+
rarity
);
#endif
int
c
=
cards
.
Length
;
//不分开,或者卡片数小于单个存档的最大值
if
(
this
.
mseHelper
.
MaxNum
==
0
||
c
<
this
.
mseHelper
.
MaxNum
)
{
this
.
SaveMSE
(
1
,
file
,
cards
,
pack_db
,
rarity
,
isUpdate
);
this
.
SaveMSE
(
1
,
file
,
cards
,
pack_db
,
rarity
,
isUpdate
);
}
else
{
...
...
@@ -322,11 +318,11 @@ public void SaveMSEs(string file, Card[] cards,bool isUpdate)
int
t
=
file
.
LastIndexOf
(
".mse-set"
);
string
fname
=
(
t
>
0
)
?
file
.
Substring
(
0
,
t
)
:
file
;
fname
+=
string
.
Format
(
"_{0}.mse-set"
,
i
+
1
);
this
.
SaveMSE
(
i
+
1
,
fname
,
clist
.
ToArray
(),
pack_db
,
rarity
,
isUpdate
);
this
.
SaveMSE
(
i
+
1
,
fname
,
clist
.
ToArray
(),
pack_db
,
rarity
,
isUpdate
);
}
}
}
public
void
SaveMSE
(
int
num
,
string
file
,
Card
[]
cards
,
string
pack_db
,
bool
rarity
,
bool
isUpdate
)
public
void
SaveMSE
(
int
num
,
string
file
,
Card
[]
cards
,
string
pack_db
,
bool
rarity
,
bool
isUpdate
)
{
string
setFile
=
file
+
".txt"
;
Dictionary
<
Card
,
string
>
images
=
this
.
mseHelper
.
WriteSet
(
setFile
,
cards
,
pack_db
,
rarity
);
...
...
@@ -352,7 +348,7 @@ public void SaveMSE(int num, string file, Card[] cards,string pack_db,bool rarit
i
++;
this
.
worker
.
ReportProgress
(
i
/
count
,
string
.
Format
(
"{0}/{1}-{2}"
,
i
,
count
,
num
));
//TODO 先裁剪图片
zips
.
AddFile
(
this
.
mseHelper
.
GetImageCache
(
img
,
c
),
Path
.
GetFileName
(
img
),
""
);
zips
.
AddFile
(
this
.
mseHelper
.
GetImageCache
(
img
,
c
),
Path
.
GetFileName
(
img
),
""
);
}
}
File
.
Delete
(
setFile
);
...
...
@@ -360,7 +356,7 @@ public void SaveMSE(int num, string file, Card[] cards,string pack_db,bool rarit
public
Card
[]
ReadMSE
(
string
mseset
,
bool
repalceOld
)
{
//解压所有文件
using
(
ZipStorer
zips
=
ZipStorer
.
Open
(
mseset
,
FileAccess
.
Read
))
using
(
ZipStorer
zips
=
ZipStorer
.
Open
(
mseset
,
FileAccess
.
Read
))
{
zips
.
EncodeUTF8
=
true
;
List
<
ZipStorer
.
ZipFileEntry
>
files
=
zips
.
ReadCentralDir
();
...
...
@@ -439,7 +435,7 @@ public void ExportData(string path, string zipname, string _cdbfile, string modu
{
if
(!
string
.
Equals
(
file
,
extra_script
)
&&
File
.
Exists
(
file
))
{
zips
.
AddFile
(
file
,
file
.
Replace
(
path
,
""
),
""
);
zips
.
AddFile
(
file
,
file
.
Replace
(
path
,
""
),
""
);
}
}
}
...
...
@@ -531,7 +527,7 @@ public void Run()
this
.
isRun
=
false
;
this
.
lastTask
=
this
.
nowTask
;
this
.
nowTask
=
MyTask
.
NONE
;
if
(
this
.
lastTask
!=
MyTask
.
ReadMSE
)
if
(
this
.
lastTask
!=
MyTask
.
ReadMSE
)
{
this
.
cardlist
=
null
;
}
...
...
DataEditorX/Core/YGOUtil.cs
View file @
44764797
using
System
;
using
System.Text
;
using
System.IO
;
using
System.Collections.Generic
;
using
System.Text.RegularExpressions
;
using
Microsoft.VisualBasic.FileIO
;
using
System.Configuration
;
using
DataEditorX.Config
;
using
DataEditorX.Config
;
using
DataEditorX.Core.Info
;
using
Microsoft.VisualBasic.FileIO
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Text
;
namespace
DataEditorX.Core
{
...
...
@@ -271,7 +268,8 @@ public static void CardRename(long newid, long oldid, YgoPath ygopath)
{
if
(
File
.
Exists
(
oldfiles
[
i
]))
{
try
{
try
{
File
.
Move
(
oldfiles
[
i
],
newfiles
[
i
]);
}
catch
{
}
...
...
@@ -290,7 +288,8 @@ public static void CardCopy(long newid, long oldid, YgoPath ygopath)
{
if
(
File
.
Exists
(
oldfiles
[
i
]))
{
try
{
try
{
File
.
Copy
(
oldfiles
[
i
],
newfiles
[
i
],
false
);
}
catch
{
}
...
...
DataEditorX/DataEditForm.cs
View file @
44764797
...
...
@@ -5,18 +5,17 @@
* 时间: 20:22
*
*/
using
DataEditorX.Common
;
using
DataEditorX.Config
;
using
DataEditorX.Core
;
using
DataEditorX.Core.Mse
;
using
DataEditorX.Language
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Globalization
;
using
System.IO
;
using
System.Windows.Forms
;
using
DataEditorX.Common
;
using
DataEditorX.Config
;
using
DataEditorX.Core
;
using
DataEditorX.Core.Mse
;
using
DataEditorX.Language
;
using
WeifenLuo.WinFormsUI.Docking
;
namespace
DataEditorX
...
...
@@ -343,17 +342,20 @@ void InitCheckPanel(FlowLayoutPanel fpanel, Dictionary<long, string> dic)
foreach
(
long
key
in
dic
.
Keys
)
{
string
value
=
dic
[
key
];
if
(
value
!=
null
&&
value
.
StartsWith
(
"NULL"
))
if
(
value
!=
null
&&
value
.
StartsWith
(
"NULL"
))
{
Label
lab
=
new
Label
();
string
[]
sizes
=
value
.
Split
(
','
);
if
(
sizes
.
Length
>=
3
){
lab
.
Size
=
new
Size
(
int
.
Parse
(
sizes
[
1
]),
int
.
Parse
(
sizes
[
2
]));
if
(
sizes
.
Length
>=
3
)
{
lab
.
Size
=
new
Size
(
int
.
Parse
(
sizes
[
1
]),
int
.
Parse
(
sizes
[
2
]));
}
lab
.
AutoSize
=
false
;
lab
.
Margin
=
fpanel
.
Margin
;
fpanel
.
Controls
.
Add
(
lab
);
}
else
{
}
else
{
CheckBox
_cbox
=
new
CheckBox
{
//_cbox.Name = fpanel.Name + key.ToString("x");
...
...
@@ -404,12 +406,14 @@ void InitListRows()
if
(
itemH
>
0
)
{
int
n
=
(
this
.
lv_cardlist
.
Height
-
headH
)
/
itemH
;
if
(
n
>
0
){
if
(
n
>
0
)
{
this
.
maxRow
=
n
;
}
//MessageBox.Show("height="+lv_cardlist.Height+",item="+itemH+",head="+headH+",max="+MaxRow);
}
if
(
addTest
){
if
(
addTest
)
{
this
.
lv_cardlist
.
Items
.
Clear
();
}
if
(
this
.
maxRow
<
10
)
...
...
@@ -587,13 +591,13 @@ public Card GetOldCard()
return
this
.
oldCard
;
}
private
void
setLinkMarks
(
long
mark
,
bool
setCheck
=
false
)
private
void
setLinkMarks
(
long
mark
,
bool
setCheck
=
false
)
{
if
(
setCheck
)
if
(
setCheck
)
{
this
.
SetCheck
(
this
.
pl_markers
,
mark
);
}
this
.
tb_link
.
Text
=
Convert
.
ToString
(
mark
,
2
).
PadLeft
(
9
,
'0'
);
this
.
tb_link
.
Text
=
Convert
.
ToString
(
mark
,
2
).
PadLeft
(
9
,
'0'
);
}
public
void
SetCard
(
Card
c
)
...
...
@@ -621,11 +625,13 @@ public void SetCard(Card c)
this
.
tb_setcode4
.
Text
=
setcodes
[
3
].
ToString
(
"x"
);
//type,category
this
.
SetCheck
(
this
.
pl_cardtype
,
c
.
type
);
if
(
c
.
IsType
(
Core
.
Info
.
CardType
.
TYPE_LINK
)){
if
(
c
.
IsType
(
Core
.
Info
.
CardType
.
TYPE_LINK
))
{
this
.
setLinkMarks
(
c
.
def
,
true
);
}
else
{
this
.
tb_link
.
Text
=
""
;
else
{
this
.
tb_link
.
Text
=
""
;
this
.
SetCheck
(
this
.
pl_markers
,
0
);
}
this
.
SetCheck
(
this
.
pl_category
,
c
.
category
);
...
...
@@ -1318,7 +1324,7 @@ public Card[] GetCardList(bool onlyselect)
index
=
lvitem
.
Index
+
(
this
.
page
-
1
)
*
this
.
maxRow
;
}
if
(
index
>=
0
&&
index
<
this
.
cardlist
.
Count
)
if
(
index
>=
0
&&
index
<
this
.
cardlist
.
Count
)
{
cards
.
Add
(
this
.
cardlist
[
index
]);
}
...
...
@@ -1444,8 +1450,8 @@ void SaveAsMSE(bool onlyselect)
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
bool
isUpdate
=
false
;
#
if
DEBUG
isUpdate
=
MyMsg
.
Question
(
LMSG
.
OnlySet
);
#if DEBUG
isUpdate
=
MyMsg
.
Question
(
LMSG
.
OnlySet
);
#endif
this
.
tasker
.
SetTask
(
MyTask
.
SaveAsMSE
,
cards
,
dlg
.
FileName
,
isUpdate
.
ToString
());
...
...
@@ -1543,7 +1549,7 @@ public void SetImage(long id)
if
(
this
.
menuitem_importmseimg
.
Checked
)
//显示MSE图片
{
string
msepic
=
MseMaker
.
GetCardImagePath
(
this
.
tasker
.
MSEImagePath
,
this
.
oldCard
);
if
(
File
.
Exists
(
msepic
))
if
(
File
.
Exists
(
msepic
))
{
this
.
pl_image
.
BackgroundImage
=
MyBitmap
.
ReadImage
(
msepic
);
}
...
...
@@ -1685,7 +1691,7 @@ public void CompareCards(string cdbfile, bool checktext)
//把文件添加到菜单
void
AddMenuItemFormMSE
()
{
if
(!
Directory
.
Exists
(
this
.
datapath
))
if
(!
Directory
.
Exists
(
this
.
datapath
))
{
return
;
}
...
...
@@ -1755,7 +1761,7 @@ private void menuitem_findluafunc_Click(object sender, EventArgs e)
//系列名输入时
void
setCode_InputText
(
int
index
,
ComboBox
cb
,
TextBox
tb
)
{
if
(
index
>=
0
&&
index
<
this
.
setcodeIsedit
.
Length
)
if
(
index
>=
0
&&
index
<
this
.
setcodeIsedit
.
Length
)
{
if
(
this
.
setcodeIsedit
[
index
])
//如果正在编辑
{
...
...
@@ -1959,16 +1965,22 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
}
string
msepath
=
MyPath
.
GetRealPath
(
MyConfig
.
ReadString
(
MyConfig
.
TAG_MSE_PATH
));
if
(!
File
.
Exists
(
msepath
)){
if
(!
File
.
Exists
(
msepath
))
{
MyMsg
.
Error
(
LMSG
.
exportMseImagesErr
);
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
return
;
}
else
{
if
(
MseMaker
.
MseIsRunning
()){
}
else
{
if
(
MseMaker
.
MseIsRunning
())
{
MseMaker
.
MseStop
();
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
return
;
}
else
{
}
else
{
}
}
...
...
@@ -1981,26 +1993,32 @@ void Menuitem_exportMSEimageClick(object sender, EventArgs e)
{
string
mseset
=
dlg
.
FileName
;
string
exportpath
=
MyPath
.
GetRealPath
(
MyConfig
.
ReadString
(
MyConfig
.
TAG_MSE_EXPORT
));
MseMaker
.
ExportSet
(
msepath
,
mseset
,
exportpath
,
delegate
{
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
MseMaker
.
ExportSet
(
msepath
,
mseset
,
exportpath
,
delegate
{
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
});
this
.
menuitem_exportMSEimage
.
Checked
=
true
;
}
else
{
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
this
.
menuitem_exportMSEimage
.
Checked
=
true
;
}
else
{
this
.
menuitem_exportMSEimage
.
Checked
=
false
;
}
}
}
void
Menuitem_testPendulumTextClick
(
object
sender
,
EventArgs
e
)
{
Card
c
=
this
.
GetCard
();
if
(
c
!=
null
){
if
(
c
!=
null
)
{
this
.
tasker
.
TestPendulumText
(
c
.
desc
);
}
}
void
Menuitem_export_select_sqlClick
(
object
sender
,
EventArgs
e
)
{
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
()){
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
){
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
())
{
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
DataBase
.
ExportSql
(
dlg
.
FileName
,
this
.
GetCardList
(
true
));
MyMsg
.
Show
(
"OK"
);
}
...
...
@@ -2008,8 +2026,10 @@ void Menuitem_export_select_sqlClick(object sender, EventArgs e)
}
void
Menuitem_export_all_sqlClick
(
object
sender
,
EventArgs
e
)
{
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
()){
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
){
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
())
{
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
DataBase
.
ExportSql
(
dlg
.
FileName
,
this
.
GetCardList
(
false
));
MyMsg
.
Show
(
"OK"
);
}
...
...
@@ -2041,7 +2061,8 @@ void Menuitem_autoreturnClick(object sender, EventArgs e)
int
len
=
MyConfig
.
ReadInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
if
(
cards
[
i
].
desc
!=
null
){
if
(
cards
[
i
].
desc
!=
null
)
{
cards
[
i
].
desc
=
StrUtil
.
AutoEnter
(
cards
[
i
].
desc
,
len
,
' '
);
}
}
...
...
@@ -2092,10 +2113,13 @@ void Menuitem_replaceClick(object sender, EventArgs e)
private
void
text2LinkMarks
(
string
text
)
{
try
{
try
{
long
mark
=
Convert
.
ToInt64
(
text
,
2
);
this
.
setLinkMarks
(
mark
,
true
);
}
catch
{
}
catch
{
//
}
}
...
...
@@ -2138,10 +2162,13 @@ private void menuitem_language_Click(object sender, EventArgs e)
void
Tb_linkKeyPress
(
object
sender
,
KeyPressEventArgs
e
)
{
if
(
e
.
KeyChar
!=
'0'
&&
e
.
KeyChar
!=
'1'
&&
e
.
KeyChar
!=
1
&&
e
.
KeyChar
!=
22
&&
e
.
KeyChar
!=
3
&&
e
.
KeyChar
!=
8
){
// MessageBox.Show("key="+(int)e.KeyChar);
if
(
e
.
KeyChar
!=
'0'
&&
e
.
KeyChar
!=
'1'
&&
e
.
KeyChar
!=
1
&&
e
.
KeyChar
!=
22
&&
e
.
KeyChar
!=
3
&&
e
.
KeyChar
!=
8
)
{
// MessageBox.Show("key="+(int)e.KeyChar);
e
.
Handled
=
true
;
}
else
{
}
else
{
this
.
text2LinkMarks
(
this
.
tb_link
.
Text
);
}
}
...
...
DataEditorX/Language/LMsg.cs
View file @
44764797
...
...
@@ -5,13 +5,12 @@
* 时间: 10:21
*
*/
using
System
;
namespace
DataEditorX.Language
{
public
enum
LMSG
:
uint
{
titleInfo
=
0
,
titleInfo
=
0
,
titleError
=
0x1
,
titleWarning
=
0x2
,
titleQuestion
=
0x3
,
...
...
DataEditorX/Language/LanguageHelper.cs
View file @
44764797
...
...
@@ -6,10 +6,10 @@
*
*/
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
using
System.Text
;
using
System.Globalization
;
using
System.Collections.Generic
;
using
System.Windows.Forms
;
namespace
DataEditorX.Language
...
...
DataEditorX/Language/MyMsg.cs
View file @
44764797
...
...
@@ -5,12 +5,7 @@
* 时间: 7:40
*
*/
using
System
;
using
System.IO
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Configuration
;
using
System.Collections.Generic
;
namespace
DataEditorX.Language
{
...
...
@@ -19,34 +14,34 @@ namespace DataEditorX.Language
/// </summary>
public
static
class
MyMsg
{
static
readonly
string
info
,
warning
,
error
,
question
;
static
readonly
string
_info
,
_warning
,
_error
,
_
question
;
static
MyMsg
()
{
info
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleInfo
);
warning
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleWarning
);
error
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleError
);
question
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleQuestion
);
_
info
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleInfo
);
_
warning
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleWarning
);
_
error
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleError
);
_
question
=
LanguageHelper
.
GetMsg
(
LMSG
.
titleQuestion
);
}
public
static
void
Show
(
string
strMsg
)
{
MessageBox
.
Show
(
strMsg
,
info
,
MessageBox
.
Show
(
strMsg
,
_
info
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
}
public
static
void
Warning
(
string
strWarn
)
{
MessageBox
.
Show
(
strWarn
,
warning
,
MessageBox
.
Show
(
strWarn
,
_
warning
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
}
public
static
void
Error
(
string
strError
)
{
MessageBox
.
Show
(
strError
,
error
,
MessageBox
.
Show
(
strError
,
_
error
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
}
public
static
bool
Question
(
string
strQues
)
{
if
(
MessageBox
.
Show
(
strQues
,
question
,
if
(
MessageBox
.
Show
(
strQues
,
_
question
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
)
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
)
{
return
true
;
}
...
...
@@ -57,24 +52,24 @@ public static bool Question(string strQues)
}
public
static
void
Show
(
LMSG
msg
)
{
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
info
,
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_
info
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Information
);
}
public
static
void
Warning
(
LMSG
msg
)
{
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
warning
,
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_
warning
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
}
public
static
void
Error
(
LMSG
msg
)
{
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
error
,
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_
error
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
}
public
static
bool
Question
(
LMSG
msg
)
{
if
(
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
question
,
if
(
MessageBox
.
Show
(
LanguageHelper
.
GetMsg
(
msg
),
_
question
,
MessageBoxButtons
.
OKCancel
,
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
)
MessageBoxIcon
.
Question
)
==
DialogResult
.
OK
)
{
return
true
;
}
...
...
DataEditorX/MainForm.cs
View file @
44764797
...
...
@@ -5,18 +5,16 @@
* 时间: 9:19
*
*/
using
DataEditorX.Config
;
using
DataEditorX.Controls
;
using
DataEditorX.Core
;
using
DataEditorX.Language
;
using
System
;
using
System.IO
;
using
System.
Draw
ing
;
using
System.
Thread
ing
;
using
System.Windows.Forms
;
using
WeifenLuo.WinFormsUI.Docking
;
using
DataEditorX.Language
;
using
DataEditorX.Core
;
using
DataEditorX.Config
;
using
DataEditorX.Controls
;
using
System.Threading
;
namespace
DataEditorX
{
public
partial
class
MainForm
:
Form
,
IMainForm
...
...
@@ -114,7 +112,7 @@ void InitForm()
{
if
(
dc
is
Form
)
{
LanguageHelper
.
SetFormLabel
((
Form
)
dc
);
LanguageHelper
.
SetFormLabel
(
dc
);
}
}
//添加历史菜单
...
...
@@ -385,7 +383,7 @@ void Menuitem_newClick(object sender, EventArgs e)
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
string
file
=
dlg
.
FileName
;
if
(
File
.
Exists
(
file
))
if
(
File
.
Exists
(
file
))
{
File
.
Delete
(
file
);
}
...
...
DataEditorX/Program.cs
View file @
44764797
...
...
@@ -5,14 +5,11 @@
* 时间: 12:00
*
*/
using
DataEditorX.Config
;
using
DataEditorX.Language
;
using
System
;
using
System.Configuration
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Reflection
;
using
System.Windows.Forms
;
using
DataEditorX.Config
;
using
DataEditorX.Language
;
namespace
DataEditorX
...
...
DataEditorX/Properties/AssemblyInfo.cs
View file @
44764797
#
region
Using
directives
using
System
;
using
System.Reflection
;
using
System.Runtime.InteropServices
;
...
...
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