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
1b0a5bfc
Commit
1b0a5bfc
authored
Apr 15, 2018
by
nanahira
Committed by
GitHub
Apr 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from Yumekaki/patch-2
automatically gets external script
parents
6d909b48
db508261
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1735 additions
and
13 deletions
+1735
-13
DataEditorX/Core/CardEdit.cs
DataEditorX/Core/CardEdit.cs
+23
-12
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+22
-1
DataEditorX/data/constant.lua
DataEditorX/data/constant.lua
+797
-0
DataEditorX/data/strings.conf
DataEditorX/data/strings.conf
+893
-0
No files found.
DataEditorX/Core/CardEdit.cs
View file @
1b0a5bfc
...
@@ -276,18 +276,29 @@ public bool OpenScript(bool openinthis, string addrequire)
...
@@ -276,18 +276,29 @@ 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
));
if
(
c
.
id
>
0
)
{
//card script
if
(
string
.
IsNullOrEmpty
(
addrequire
))
{
// OCG script
sw
.
WriteLine
(
"--"
+
c
.
name
);
sw
.
WriteLine
(
"function c"
+
id
.
ToString
()
+
".initial_effect(c)"
);
sw
.
WriteLine
(
"\t"
);
sw
.
WriteLine
(
"end"
);
}
else
{
// DIY script
sw
.
WriteLine
(
"--"
+
c
.
name
);
sw
.
WriteLine
(
"--"
+
c
.
name
);
sw
.
WriteLine
(
"local m="
+
id
.
ToString
());
sw
.
WriteLine
(
"local m="
+
id
.
ToString
());
sw
.
WriteLine
(
"local cm=_G[\"c\"..m]"
);
sw
.
WriteLine
(
"local cm=_G[\"c\"..m]"
);
if
(
addrequire
.
Length
>
0
)
sw
.
WriteLine
(
"xpcall(function() require(\"expansions/script/"
+
addrequire
+
"\") end,function() require(\"script/"
+
addrequire
+
"\") end)"
);
sw
.
WriteLine
(
"xpcall(function() require(\"expansions/script/"
+
addrequire
+
"\") end,function() require(\"script/"
+
addrequire
+
"\") end)"
);
sw
.
WriteLine
(
"function cm.initial_effect(c)"
);
sw
.
WriteLine
(
"function cm.initial_effect(c)"
);
sw
.
WriteLine
(
"\t"
);
sw
.
WriteLine
(
"\t"
);
sw
.
WriteLine
(
"end"
);
sw
.
WriteLine
(
"end"
);
}
else
{
//module script
sw
.
WriteLine
(
"--Module script \""
+
addrequire
+
"\""
);
}
}
/*else
{ //module script
sw.WriteLine("--Module script \"" + addrequire + "\"");
}*/
sw
.
Close
();
sw
.
Close
();
fs
.
Close
();
fs
.
Close
();
}
}
...
...
DataEditorX/DataEditForm.cs
View file @
1b0a5bfc
...
@@ -23,7 +23,28 @@ namespace DataEditorX
...
@@ -23,7 +23,28 @@ namespace DataEditorX
{
{
public
partial
class
DataEditForm
:
DockContent
,
IDataForm
public
partial
class
DataEditForm
:
DockContent
,
IDataForm
{
{
public
string
addrequire
;
private
string
addrequire_str
;
public
string
addrequire
{
get
{
if
(!
string
.
IsNullOrEmpty
(
addrequire_str
))
return
addrequire_str
;
else
{
string
cdbName
=
Path
.
GetFileNameWithoutExtension
(
nowCdbFile
);
if
(
cdbName
.
Length
>
0
&&
File
.
Exists
(
GetPath
().
GetModuleScript
(
cdbName
)))
return
cdbName
;
}
return
""
;
}
set
{
addrequire_str
=
value
;
}
}
#
region
成员变量
/
构造
#
region
成员变量
/
构造
TaskHelper
tasker
=
null
;
TaskHelper
tasker
=
null
;
string
taskname
;
string
taskname
;
...
...
DataEditorX/data/constant.lua
0 → 100644
View file @
1b0a5bfc
This diff is collapsed.
Click to expand it.
DataEditorX/data/strings.conf
0 → 100644
View file @
1b0a5bfc
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