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
522136b9
Commit
522136b9
authored
May 22, 2015
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.3.1.4
parent
38ae3542
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
93 additions
and
76 deletions
+93
-76
DataEditorX/Core/Card.cs
DataEditorX/Core/Card.cs
+8
-0
DataEditorX/Core/CardEdit.cs
DataEditorX/Core/CardEdit.cs
+3
-3
DataEditorX/Core/DataBase.cs
DataEditorX/Core/DataBase.cs
+2
-2
DataEditorX/Core/YGOUtil.cs
DataEditorX/Core/YGOUtil.cs
+39
-16
DataEditorX/DataEditForm.Designer.cs
DataEditorX/DataEditForm.Designer.cs
+1
-11
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+29
-41
DataEditorX/Properties/AssemblyInfo.cs
DataEditorX/Properties/AssemblyInfo.cs
+1
-1
DataEditorX/changed.txt
DataEditorX/changed.txt
+4
-0
DataEditorX/readme.txt
DataEditorX/readme.txt
+1
-1
win32/DataEditorX.exe
win32/DataEditorX.exe
+0
-0
win32/changed.txt
win32/changed.txt
+4
-0
win32/readme.txt
win32/readme.txt
+1
-1
win32/win32.zip
win32/win32.zip
+0
-0
No files found.
DataEditorX/Core/Card.cs
View file @
522136b9
...
...
@@ -121,6 +121,14 @@ public void SetSetCode(params string[] setcodes)
}
}
}
public
long
GetLeftScale
()
{
return
(
this
.
level
>>
0x18
)
&
0xff
;
}
public
long
GetRightScale
()
{
return
(
this
.
level
>>
0x10
)
&
0xff
;
}
#
endregion
#
region
比较、哈希值、操作符
...
...
DataEditorX/Core/CardEdit.cs
View file @
522136b9
...
...
@@ -166,7 +166,7 @@ public bool DelCards(bool deletefiles)
//删除资源
if
(
deletefiles
)
{
YGOUtil
.
CardDelete
(
c
.
id
,
dataform
.
GetPath
(),
true
);
YGOUtil
.
CardDelete
(
c
.
id
,
dataform
.
GetPath
(),
YGOUtil
.
DeleteOption
.
BACKUP
);
delete
.
deleted
=
true
;
delete
.
ids
.
Add
(
c
.
id
);
}
...
...
@@ -238,7 +238,7 @@ public void Undo()
return
;
}
DataBase
.
Command
(
dataform
.
GetOpenFile
(),
undoSQL
[
undoSQL
.
Count
-
1
]);
undoSQL
.
RemoveAt
(
undoSQL
.
Count
-
1
);
undoSQL
.
RemoveAt
(
undoSQL
.
Count
-
1
);
if
(
undoModified
[
undoModified
.
Count
-
1
].
modifiled
)
{
FileModified
lastmodify
=
undoModified
[
undoModified
.
Count
-
1
];
...
...
@@ -249,7 +249,7 @@ public void Undo()
{
FileDeleted
lastdelete
=
undoDeleted
[
undoDeleted
.
Count
-
1
];
foreach
(
long
id
in
lastdelete
.
ids
)
YGOUtil
.
CardDelete
(
id
,
dataform
.
GetPath
(),
false
,
true
);
YGOUtil
.
CardDelete
(
id
,
dataform
.
GetPath
(),
YGOUtil
.
DeleteOption
.
RESTORE
);
}
undoDeleted
.
RemoveAt
(
undoDeleted
.
Count
-
1
);
dataform
.
Search
(
true
);
...
...
DataEditorX/Core/DataBase.cs
View file @
522136b9
...
...
@@ -312,8 +312,8 @@ public static string GetSelectSQL(Card c)
sb
.
Append
(
" and datas.ot = "
+
c
.
ot
.
ToString
());
if
(
c
.
attribute
>
0
)
sb
.
Append
(
" and datas.attribute = "
+
c
.
attribute
.
ToString
());
if
(
c
.
level
>
0
)
sb
.
Append
(
" and (datas.level & 255) = "
+
toInt
(
c
.
level
));
if
((
c
.
level
&
0xff
)
>
0
)
sb
.
Append
(
" and (datas.level & 255) = "
+
toInt
(
c
.
level
&
0xff
));
if
(
c
.
race
>
0
)
sb
.
Append
(
" and datas.race = "
+
toInt
(
c
.
race
));
if
(
c
.
type
>
0
)
...
...
DataEditorX/Core/YGOUtil.cs
View file @
522136b9
...
...
@@ -205,30 +205,53 @@ public static string[] ReadImage(string path)
#
region
删除资源
//删除资源
public
static
void
CardDelete
(
long
id
,
YgoPath
ygopath
,
bool
bak
,
bool
restore
=
false
)
public
enum
DeleteOption
{
BACKUP
,
RESTORE
,
CLEAN
,
NONE
,
}
public
static
void
CardDelete
(
long
id
,
YgoPath
ygopath
,
DeleteOption
option
)
{
string
[]
files
=
ygopath
.
GetCardfiles
(
id
,
restore
);
string
[]
files
=
ygopath
.
GetCardfiles
(
id
);
string
[]
bakfiles
=
ygopath
.
GetCardfiles
(
id
,
true
);
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
{
if
(
File
.
Exists
(
files
[
i
]))
{
if
(
restore
)
switch
(
option
)
{
case
DeleteOption
.
BACKUP
:
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
{
File
.
Move
(
files
[
i
],
files
[
i
].
Replace
(
"bak"
,
""
));
return
;
if
(
File
.
Exists
(
bakfiles
[
i
]))
File
.
Delete
(
bakfiles
[
i
]);
if
(
File
.
Exists
(
files
[
i
]))
File
.
Move
(
files
[
i
],
files
[
i
]
+
".bak"
);
}
if
(
bak
)
break
;
case
DeleteOption
.
RESTORE
:
for
(
int
i
=
0
;
i
<
bakfiles
.
Length
;
i
++)
{
if
(
File
.
Exists
(
files
[
i
]))
File
.
Delete
(
files
[
i
]);
if
(
File
.
Exists
(
bakfiles
[
i
]))
File
.
Move
(
bakfiles
[
i
],
bakfiles
[
i
].
Replace
(
"bak"
,
""
));
}
break
;
case
DeleteOption
.
CLEAN
:
for
(
int
i
=
0
;
i
<
bakfiles
.
Length
;
i
++)
{
if
(
File
.
Exists
(
bakfiles
[
i
]))
File
.
Delete
(
bakfiles
[
i
]);
File
.
Move
(
files
[
i
],
files
[
i
]
+
".bak"
);
}
else
File
.
Delete
(
files
[
i
]);
//删除文件
}
}
break
;
case
DeleteOption
.
NONE
:
for
(
int
i
=
0
;
i
<
files
.
Length
;
i
++)
{
if
(
File
.
Exists
(
files
[
i
]))
File
.
Delete
(
files
[
i
]);
}
break
;
}
}
#
endregion
...
...
DataEditorX/DataEditForm.Designer.cs
View file @
522136b9
...
...
@@ -64,7 +64,6 @@ private void InitializeComponent()
this
.
menuitem_compdb
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
menuitem_findluafunc
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
menuitem_exportdata
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
menuitem_saveasenter
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tsep5
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
menuitem_cutimages
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
menuitem_convertimage
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
...
...
@@ -282,7 +281,6 @@ private void InitializeComponent()
this
.
menuitem_compdb
,
this
.
menuitem_findluafunc
,
this
.
menuitem_exportdata
,
this
.
menuitem_saveasenter
,
this
.
tsep5
,
this
.
menuitem_cutimages
,
this
.
menuitem_convertimage
,
...
...
@@ -351,13 +349,6 @@ private void InitializeComponent()
this
.
menuitem_exportdata
.
Text
=
"Export Data"
;
this
.
menuitem_exportdata
.
Click
+=
new
System
.
EventHandler
(
this
.
Menuitem_exportdataClick
);
//
// menuitem_saveasenter
//
this
.
menuitem_saveasenter
.
Name
=
"menuitem_saveasenter"
;
this
.
menuitem_saveasenter
.
Size
=
new
System
.
Drawing
.
Size
(
212
,
22
);
this
.
menuitem_saveasenter
.
Text
=
"Save as Auto Enter"
;
this
.
menuitem_saveasenter
.
Click
+=
new
System
.
EventHandler
(
this
.
menuitem_saveasenter_Click
);
//
// tsep5
//
this
.
tsep5
.
Name
=
"tsep5"
;
...
...
@@ -1194,8 +1185,7 @@ private void InitializeComponent()
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_cutimages
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_operacardsfile
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
tsep2
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_openfileinthis
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_saveasenter
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_openfileinthis
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_autocheckupdate
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
menuitem_language
;
}
...
...
DataEditorX/DataEditForm.cs
View file @
522136b9
...
...
@@ -147,7 +147,19 @@ void DataEditFormLoad(object sender, EventArgs e)
}
//窗体关闭
void
DataEditFormFormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
{
//清理备份文件
List
<
long
>
delids
=
new
List
<
long
>();
foreach
(
CardEdit
.
FileDeleted
deleted
in
cardedit
.
undoDeleted
)
{
if
(
deleted
!=
null
&&
deleted
.
deleted
)
delids
.
AddRange
(
deleted
.
ids
);
}
if
(
delids
.
Count
!=
0
)
{
foreach
(
long
id
in
delids
)
YGOUtil
.
CardDelete
(
id
,
GetPath
(),
YGOUtil
.
DeleteOption
.
CLEAN
);
}
//当前有任务执行,是否结束
if
(
tasker
!=
null
&&
tasker
.
IsRuning
())
{
...
...
@@ -156,7 +168,6 @@ void DataEditFormFormClosing(object sender, FormClosingEventArgs e)
e
.
Cancel
=
true
;
return
;
}
}
}
//窗体激活
...
...
@@ -626,6 +637,18 @@ public bool Open(string file)
return
true
;
}
//setcode, 灵摆刻度的搜索
public
bool
CardFilter
(
Card
c
,
Card
sc
)
{
bool
res
=
true
;
if
(
sc
.
setcode
!=
0
)
res
&=
c
.
IsSetCode
(
sc
.
setcode
&
0xffff
);
if
(
sc
.
GetLeftScale
()
!=
0
)
res
&=
(
c
.
GetLeftScale
()
==
sc
.
GetLeftScale
());
if
(
sc
.
GetRightScale
()
!=
0
)
res
&=
(
c
.
GetRightScale
()
==
sc
.
GetRightScale
());
return
res
;
}
//设置卡片列表的结果
public
void
SetCards
(
Card
[]
cards
,
bool
isfresh
)
{
...
...
@@ -634,10 +657,8 @@ public void SetCards(Card[] cards, bool isfresh)
cardlist
.
Clear
();
foreach
(
Card
c
in
cards
)
{
if
(
srcCard
.
setcode
==
0
)
cardlist
.
Add
(
c
);
//setcode搜索在这里进行
else
if
(
c
.
IsSetCode
(
srcCard
.
setcode
&
0xffff
))
cardlist
.
Add
(
c
);
if
(
CardFilter
(
c
,
srcCard
))
cardlist
.
Add
(
c
);
}
cardcount
=
cardlist
.
Count
;
pageNum
=
cardcount
/
MaxRow
;
...
...
@@ -1117,9 +1138,9 @@ public void SaveCards(Card[] cards)
cardedit
.
undoSQL
.
Add
(
undo
);
cardedit
.
undoModified
.
Add
(
new
CardEdit
.
FileModified
());
cardedit
.
undoDeleted
.
Add
(
new
CardEdit
.
FileDeleted
());
btn_undo
.
Enabled
=
true
;
DataBase
.
CopyDB
(
nowCdbFile
,
!
replace
,
cards
);
Search
(
srcCard
,
true
);
Search
(
srcCard
,
true
);
btn_undo
.
Enabled
=
true
;
}
//卡片另存为
void
CopyTo
(
Card
[]
cards
)
...
...
@@ -1601,38 +1622,5 @@ void SetLanguage_Click(object sender, EventArgs e)
}
}
#
endregion
#
region
空格
private
void
menuitem_saveasenter_Click
(
object
sender
,
EventArgs
e
)
{
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
())
{
dlg
.
Title
=
LanguageHelper
.
GetMsg
(
LMSG
.
SelectDataBasePath
);
dlg
.
Filter
=
LanguageHelper
.
GetMsg
(
LMSG
.
CdbType
);
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
OK
)
{
Card
[]
cards
=
DataBase
.
Read
(
nowCdbFile
,
true
,
""
);
int
count
=
cards
.
Length
;
if
(
cards
==
null
||
cards
.
Length
==
0
)
return
;
if
(
DataBase
.
Create
(
dlg
.
FileName
))
{
//
int
len
=
MyConfig
.
readInteger
(
MyConfig
.
TAG_AUTO_LEN
,
30
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
cards
[
i
].
desc
=
StrUtil
.
AutoEnter
(
cards
[
i
].
desc
,
len
,
' '
);
for
(
int
j
=
0
;
j
<
Card
.
STR_MAX
;
j
++)
{
cards
[
i
].
Str
[
j
]
=
StrUtil
.
AutoEnter
(
cards
[
i
].
Str
[
j
],
len
,
' '
);
}
}
DataBase
.
CopyDB
(
dlg
.
FileName
,
false
,
cards
);
MyMsg
.
Show
(
LMSG
.
CopyCardsToDBIsOK
);
}
}
}
}
#
endregion
}
}
DataEditorX/Properties/AssemblyInfo.cs
View file @
522136b9
...
...
@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[
assembly
:
AssemblyVersion
(
"2.3.1.
3
"
)]
[
assembly
:
AssemblyVersion
(
"2.3.1.
4
"
)]
DataEditorX/changed.txt
View file @
522136b9
★更新历史
2.3.1.4
增加灵摆刻度的搜索功能
关闭数据库时清理备份文件
移除分行功能
2.3.1.3
优化复制卡片的撤销
2.3.1.2
...
...
DataEditorX/readme.txt
View file @
522136b9
[DataEditorX]2.3.1.
3
[DataEditorX]
[DataEditorX]2.3.1.
4
[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
...
...
win32/DataEditorX.exe
View file @
522136b9
No preview for this file type
win32/changed.txt
View file @
522136b9
★更新历史
2.3.1.4
增加灵摆刻度的搜索功能
关闭数据库时清理备份文件
移除分行功能
2.3.1.3
优化复制卡片的撤销
2.3.1.2
...
...
win32/readme.txt
View file @
522136b9
[DataEditorX]2.3.1.
3
[DataEditorX]
[DataEditorX]2.3.1.
4
[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★运行环境(Environment)
...
...
win32/win32.zip
View file @
522136b9
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment