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
c34b128b
Commit
c34b128b
authored
Sep 09, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
1c7b883a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
DataEditorX/Config/YgoPath.cs
DataEditorX/Config/YgoPath.cs
+4
-0
DataEditorX/Core/CardEdit.cs
DataEditorX/Core/CardEdit.cs
+20
-11
DataEditorX/Core/TaskHelper.cs
DataEditorX/Core/TaskHelper.cs
+1
-2
No files found.
DataEditorX/Config/YgoPath.cs
View file @
c34b128b
...
@@ -73,6 +73,10 @@ public string GetScript(string id)
...
@@ -73,6 +73,10 @@ public string GetScript(string id)
{
{
return
MyPath
.
Combine
(
luapath
,
"c"
+
id
+
".lua"
);
return
MyPath
.
Combine
(
luapath
,
"c"
+
id
+
".lua"
);
}
}
public
string
GetModuleScript
(
string
modulescript
)
{
return
MyPath
.
Combine
(
luapath
,
modulescript
+
".lua"
);
}
public
string
[]
GetCardfiles
(
long
id
)
public
string
[]
GetCardfiles
(
long
id
)
{
{
...
...
DataEditorX/Core/CardEdit.cs
View file @
c34b128b
...
@@ -258,10 +258,15 @@ public bool OpenScript(bool openinthis, string addrequire)
...
@@ -258,10 +258,15 @@ public bool OpenScript(bool openinthis, string addrequire)
if
(!
dataform
.
CheckOpen
())
if
(!
dataform
.
CheckOpen
())
return
false
;
return
false
;
Card
c
=
dataform
.
GetCard
();
Card
c
=
dataform
.
GetCard
();
if
(
c
.
id
<=
0
)
//卡片密码不能小于等于0
return
false
;
long
id
=
c
.
id
;
long
id
=
c
.
id
;
string
lua
=
dataform
.
GetPath
().
GetScript
(
id
);
string
lua
;
if
(
c
.
id
>
0
)
{
lua
=
dataform
.
GetPath
().
GetScript
(
id
);
}
else
if
(
addrequire
.
Length
>
0
)
{
lua
=
dataform
.
GetPath
().
GetModuleScript
(
addrequire
);
}
else
{
return
false
;
}
if
(!
File
.
Exists
(
lua
))
if
(!
File
.
Exists
(
lua
))
{
{
MyPath
.
CreateDirByFile
(
lua
);
MyPath
.
CreateDirByFile
(
lua
);
...
@@ -271,14 +276,18 @@ public bool OpenScript(bool openinthis, string addrequire)
...
@@ -271,14 +276,18 @@ public bool OpenScript(bool openinthis, string addrequire)
FileMode
.
OpenOrCreate
,
FileAccess
.
Write
))
FileMode
.
OpenOrCreate
,
FileAccess
.
Write
))
{
{
StreamWriter
sw
=
new
StreamWriter
(
fs
,
new
UTF8Encoding
(
false
));
StreamWriter
sw
=
new
StreamWriter
(
fs
,
new
UTF8Encoding
(
false
));
sw
.
WriteLine
(
"--"
+
c
.
name
);
if
(
c
.
id
>
0
)
{
//card script
sw
.
WriteLine
(
"local m="
+
id
.
ToString
());
sw
.
WriteLine
(
"--"
+
c
.
name
);
sw
.
WriteLine
(
"local cm=_G[\"c\"..m]"
);
sw
.
WriteLine
(
"local m="
+
id
.
ToString
());
if
(
addrequire
.
Length
>
0
)
sw
.
WriteLine
(
"local cm=_G[\"c\"..m]"
);
sw
.
WriteLine
(
"xpcall(function() require(\"expansions/script/"
+
addrequire
+
"\") end,function() require(\"script/"
+
addrequire
+
"\") end)"
);
if
(
addrequire
.
Length
>
0
)
sw
.
WriteLine
(
"function cm.initial_effect(c)"
);
sw
.
WriteLine
(
"xpcall(function() require(\"expansions/script/"
+
addrequire
+
"\") end,function() require(\"script/"
+
addrequire
+
"\") end)"
);
sw
.
WriteLine
(
"\t"
);
sw
.
WriteLine
(
"function cm.initial_effect(c)"
);
sw
.
WriteLine
(
"end"
);
sw
.
WriteLine
(
"\t"
);
sw
.
WriteLine
(
"end"
);
}
else
{
//module script
sw
.
WriteLine
(
"--Module script \""
+
addrequire
+
"\""
);
}
sw
.
Close
();
sw
.
Close
();
fs
.
Close
();
fs
.
Close
();
}
}
...
...
DataEditorX/Core/TaskHelper.cs
View file @
c34b128b
...
@@ -350,10 +350,9 @@ public void ExportData(string path, string zipname, string _cdbfile, string modu
...
@@ -350,10 +350,9 @@ public void ExportData(string path, string zipname, string _cdbfile, string modu
//新卡ydk
//新卡ydk
string
deckydk
=
ygopath
.
GetYdk
(
name
);
string
deckydk
=
ygopath
.
GetYdk
(
name
);
//module scripts
//module scripts
string
script_path
=
MyPath
.
Combine
(
path
,
"script"
);
string
extra_script
=
""
;
string
extra_script
=
""
;
if
(
modulescript
.
Length
>
0
)
if
(
modulescript
.
Length
>
0
)
extra_script
=
MyPath
.
Combine
(
script_path
,
modulescript
+
".lua"
);
extra_script
=
ygopath
.
GetModuleScript
(
modulescript
);
File
.
Delete
(
cdbfile
);
File
.
Delete
(
cdbfile
);
DataBase
.
Create
(
cdbfile
);
DataBase
.
Create
(
cdbfile
);
...
...
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