Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
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
hex
YGOProUnity_V2
Commits
9b23705f
You need to sign in or sign up before continuing.
Commit
9b23705f
authored
Aug 28, 2021
by
mercury233
Committed by
GitHub
Aug 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support command lines (#20)
parent
0db689f2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
139 additions
and
13 deletions
+139
-13
Assets/SibylSystem/Menu/Menu.cs
Assets/SibylSystem/Menu/Menu.cs
+15
-3
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+5
-1
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+83
-1
Assets/SibylSystem/Room/AIRoom.cs
Assets/SibylSystem/Room/AIRoom.cs
+9
-1
Assets/SibylSystem/SelectDeck/selectDeck.cs
Assets/SibylSystem/SelectDeck/selectDeck.cs
+15
-4
Assets/SibylSystem/puzzleSystem/puzzleMode.cs
Assets/SibylSystem/puzzleSystem/puzzleMode.cs
+4
-1
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+4
-1
Assets/SibylSystem/selectServer/SelectServer.cs
Assets/SibylSystem/selectServer/SelectServer.cs
+4
-1
No files found.
Assets/SibylSystem/Menu/Menu.cs
View file @
9b23705f
...
...
@@ -105,7 +105,7 @@ public class Menu : WindowServantSP
}
}
void
onClickExit
()
public
void
onClickExit
()
{
Program
.
I
().
quit
();
Program
.
Running
=
false
;
...
...
@@ -194,8 +194,20 @@ public class Menu : WindowServantSP
string
all
=
""
;
try
{
all
=
File
.
ReadAllText
(
"commamd.shell"
,
Encoding
.
UTF8
);
string
[]
mats
=
all
.
Split
(
" "
);
all
=
File
.
ReadAllText
(
"commamd.shell"
,
Encoding
.
UTF8
);
char
[]
parmChars
=
all
.
ToCharArray
();
bool
inQuote
=
false
;
for
(
int
index
=
0
;
index
<
parmChars
.
Length
;
index
++)
{
if
(
parmChars
[
index
]
==
'"'
)
{
inQuote
=
!
inQuote
;
parmChars
[
index
]
=
'\n'
;
}
if
(!
inQuote
&&
parmChars
[
index
]
==
' '
)
parmChars
[
index
]
=
'\n'
;
}
string
[]
mats
=
(
new
string
(
parmChars
)).
Split
(
new
char
[]
{
'\n'
},
StringSplitOptions
.
RemoveEmptyEntries
);
if
(
mats
.
Length
>
0
)
{
switch
(
mats
[
0
])
...
...
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
9b23705f
...
...
@@ -758,7 +758,11 @@ public class Ocgcore : ServantWithCardDescription
public
void
returnTo
()
{
TcpHelper
.
SaveRecord
();
if
(
returnServant
!=
null
)
if
(
Program
.
exitOnReturn
)
{
Program
.
I
().
menu
.
onClickExit
();
}
else
if
(
returnServant
!=
null
)
{
Program
.
I
().
shiftToServant
(
returnServant
);
}
...
...
Assets/SibylSystem/Program.cs
View file @
9b23705f
...
...
@@ -412,11 +412,91 @@ public class Program : MonoBehaviour
initializeALLservants
();
loadResources
();
readParams
();
});
}
void
readParams
()
{
var
args
=
Environment
.
GetCommandLineArgs
();
string
nick
=
null
;
string
host
=
null
;
string
port
=
null
;
string
password
=
null
;
string
deck
=
null
;
string
replay
=
null
;
string
puzzle
=
null
;
bool
join
=
false
;
for
(
int
i
=
0
;
i
<
args
.
Length
;
i
++)
{
if
(
args
[
i
].
ToLower
()
==
"-n"
&&
args
.
Length
>
i
+
1
)
{
nick
=
args
[++
i
];
if
(
nick
.
Contains
(
" "
))
nick
=
"\""
+
nick
+
"\""
;
}
if
(
args
[
i
].
ToLower
()
==
"-h"
&&
args
.
Length
>
i
+
1
)
{
host
=
args
[++
i
];
}
if
(
args
[
i
].
ToLower
()
==
"-p"
&&
args
.
Length
>
i
+
1
)
{
port
=
args
[++
i
];
}
if
(
args
[
i
].
ToLower
()
==
"-w"
&&
args
.
Length
>
i
+
1
)
{
password
=
args
[++
i
];
if
(
password
.
Contains
(
" "
))
password
=
"\""
+
password
+
"\""
;
}
if
(
args
[
i
].
ToLower
()
==
"-d"
&&
args
.
Length
>
i
+
1
)
{
deck
=
args
[++
i
];
if
(
deck
.
Contains
(
" "
))
deck
=
"\""
+
deck
+
"\""
;
}
if
(
args
[
i
].
ToLower
()
==
"-r"
&&
args
.
Length
>
i
+
1
)
{
replay
=
args
[++
i
];
if
(
replay
.
Contains
(
" "
))
replay
=
"\""
+
replay
+
"\""
;
}
if
(
args
[
i
].
ToLower
()
==
"-s"
&&
args
.
Length
>
i
+
1
)
{
puzzle
=
args
[++
i
];
if
(
puzzle
.
Contains
(
" "
))
puzzle
=
"\""
+
puzzle
+
"\""
;
}
if
(
args
[
i
].
ToLower
()
==
"-j"
)
{
join
=
true
;
Config
.
Set
(
"deckInUse"
,
deck
);
}
}
string
cmdFile
=
"commamd.shell"
;
if
(
join
)
{
File
.
WriteAllText
(
cmdFile
,
"online "
+
nick
+
" "
+
host
+
" "
+
port
+
" 0x233 "
+
password
,
Encoding
.
UTF8
);
Program
.
exitOnReturn
=
true
;
}
else
if
(
deck
!=
null
)
{
File
.
WriteAllText
(
cmdFile
,
"edit "
+
deck
,
Encoding
.
UTF8
);
Program
.
exitOnReturn
=
true
;
}
else
if
(
replay
!=
null
)
{
File
.
WriteAllText
(
cmdFile
,
"replay "
+
replay
,
Encoding
.
UTF8
);
Program
.
exitOnReturn
=
true
;
}
else
if
(
puzzle
!=
null
)
{
File
.
WriteAllText
(
cmdFile
,
"puzzle "
+
puzzle
,
Encoding
.
UTF8
);
Program
.
exitOnReturn
=
true
;
}
}
public
GameObject
mouseParticle
;
static
int
lastChargeTime
=
0
;
...
...
@@ -1040,6 +1120,8 @@ public class Program : MonoBehaviour
public
static
bool
noAccess
=
false
;
public
static
bool
exitOnReturn
=
false
;
void
OnApplicationQuit
()
{
TcpHelper
.
SaveRecord
();
...
...
Assets/SibylSystem/Room/AIRoom.cs
View file @
9b23705f
...
...
@@ -26,7 +26,7 @@ public class AIRoom : WindowServantSP
UIHelper
.
registEvent
(
gameObject
,
"aideck_"
,
onSave
);
UIHelper
.
registEvent
(
gameObject
,
"rank_"
,
onSave
);
UIHelper
.
registEvent
(
gameObject
,
"start_"
,
onStart
);
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
()=>
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
);
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
onClickExit
);
UIHelper
.
trySetLableText
(
gameObject
,
"percyHint"
,
InterString
.
Get
(
"人机模式"
));
superScrollView
.
install
();
SetActiveFalse
();
...
...
@@ -43,6 +43,14 @@ public class AIRoom : WindowServantSP
Config
.
Set
(
"list_airank"
,
list_airank
.
value
);
}
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
void
onStart
()
{
if
(!
isShowed
)
...
...
Assets/SibylSystem/SelectDeck/selectDeck.cs
View file @
9b23705f
...
...
@@ -62,6 +62,14 @@ public class selectDeck : WindowServantSP
KF_editDeck
(
superScrollView
.
selectedString
);
}
void
returnToSelect
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
}
string
preString
=
""
;
public
override
void
preFrameFunction
()
...
...
@@ -100,7 +108,7 @@ public class selectDeck : WindowServantSP
);
}
else
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
returnToSelect
(
);
}
};
}
...
...
@@ -115,12 +123,12 @@ public class selectDeck : WindowServantSP
{
if
(
Program
.
I
().
deckManager
.
onSave
())
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
returnToSelect
(
);
}
}
if
(
result
[
0
].
value
==
"no"
)
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectDeck
);
returnToSelect
(
);
}
}
if
(
hashCode
==
"onNew"
)
...
...
@@ -508,6 +516,9 @@ public class selectDeck : WindowServantSP
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
...
...
Assets/SibylSystem/puzzleSystem/puzzleMode.cs
View file @
9b23705f
...
...
@@ -70,6 +70,9 @@ public class puzzleMode : WindowServantSP
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
9b23705f
...
...
@@ -519,6 +519,9 @@ public class selectReplay : WindowServantSP
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
...
...
Assets/SibylSystem/selectServer/SelectServer.cs
View file @
9b23705f
...
...
@@ -109,6 +109,9 @@ public class SelectServer : WindowServantSP
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
if
(
TcpHelper
.
tcpClient
!=
null
)
{
...
...
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