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
fallenstardust
YGOProUnity_V2
Commits
f35f6b22
Commit
f35f6b22
authored
Sep 12, 2021
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deck group, remove AIRoom
parent
7693090c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
206 additions
and
213 deletions
+206
-213
Assets/SibylSystem/Menu/Menu.cs
Assets/SibylSystem/Menu/Menu.cs
+4
-4
Assets/SibylSystem/MonoHelpers/UIHelper.cs
Assets/SibylSystem/MonoHelpers/UIHelper.cs
+23
-0
Assets/SibylSystem/Program.cs
Assets/SibylSystem/Program.cs
+5
-5
Assets/SibylSystem/Room/AIRoom.cs
Assets/SibylSystem/Room/AIRoom.cs
+135
-135
Assets/SibylSystem/Room/Room.cs
Assets/SibylSystem/Room/Room.cs
+1
-17
Assets/SibylSystem/SelectDeck/selectDeck.cs
Assets/SibylSystem/SelectDeck/selectDeck.cs
+16
-30
Assets/SibylSystem/precy.cs
Assets/SibylSystem/precy.cs
+22
-22
No files found.
Assets/SibylSystem/Menu/Menu.cs
View file @
f35f6b22
...
...
@@ -117,10 +117,10 @@ public class Menu : WindowServantSP
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
}
private
void
onClickAI
()
{
Program
.
I
().
shiftToServant
(
Program
.
I
().
aiRoom
);
}
//
private void onClickAI()
//
{
//
Program.I().shiftToServant(Program.I().aiRoom);
//
}
private
void
onClickPizzle
()
{
...
...
Assets/SibylSystem/MonoHelpers/UIHelper.cs
View file @
f35f6b22
...
...
@@ -830,6 +830,29 @@ public static class UIHelper
screenposition
.
z
+
l
));
}
public
const
string
sort
=
"sortByTimeDeck"
;
public
static
IOrderedEnumerable
<
FileInfo
>
SortDeck
(
this
IOrderedEnumerable
<
FileInfo
>
source
)
{
return
Config
.
Get
(
sort
,
"1"
)
==
"1"
?
source
.
ThenByDescending
(
f
=>
f
.
LastWriteTime
)
:
source
.
ThenBy
(
f
=>
f
.
Name
);
}
public
static
IEnumerable
<
string
>
GetDecks
(
string
search
=
""
)
{
var
deckInUse
=
Config
.
Get
(
"deckInUse"
,
"miaowu"
);
var
deckInUsePath
=
Path
.
GetFullPath
(
$"deck/
{
deckInUse
}
.ydk"
);
return
new
DirectoryInfo
(
"deck"
).
EnumerateFiles
(
"*.ydk"
,
SearchOption
.
AllDirectories
)
.
Where
(
f
=>
search
==
""
||
f
.
Name
.
Contains
(
search
))
.
OrderByDescending
(
f
=>
f
.
FullName
==
deckInUsePath
)
.
ThenBy
(
f
=>
f
.
DirectoryName
)
.
SortDeck
()
.
Select
(
f
=>
f
.
DirectoryName
==
Path
.
GetFullPath
(
"deck"
)
?
Path
.
GetFileNameWithoutExtension
(
f
.
Name
)
:
$"
{
Path
.
GetFileName
(
f
.
DirectoryName
)}
/
{
Path
.
GetFileNameWithoutExtension
(
f
.
Name
)}
"
);
}
public
static
int
CompareTime
(
object
x
,
object
y
)
{
...
...
Assets/SibylSystem/Program.cs
View file @
f35f6b22
...
...
@@ -715,7 +715,7 @@ public class Program : MonoBehaviour
public
SelectServer
selectServer
;
public
Book
book
;
public
puzzleMode
puzzleMode
;
public
AIRoom
aiRoom
;
//
public AIRoom aiRoom;
private
void
initializeALLservants
()
{
...
...
@@ -740,8 +740,8 @@ public class Program : MonoBehaviour
servants
.
Add
(
selectReplay
);
puzzleMode
=
new
puzzleMode
();
servants
.
Add
(
puzzleMode
);
aiRoom
=
new
AIRoom
();
servants
.
Add
(
aiRoom
);
//
aiRoom = new AIRoom();
//
servants.Add(aiRoom);
}
public
void
shiftToServant
(
Servant
to
)
...
...
@@ -756,7 +756,7 @@ public class Program : MonoBehaviour
if
(
to
!=
selectServer
&&
selectServer
.
isShowed
)
selectServer
.
hide
();
if
(
to
!=
selectReplay
&&
selectReplay
.
isShowed
)
selectReplay
.
hide
();
if
(
to
!=
puzzleMode
&&
puzzleMode
.
isShowed
)
puzzleMode
.
hide
();
if
(
to
!=
aiRoom
&&
aiRoom
.
isShowed
)
aiRoom
.
hide
();
//
if (to != aiRoom && aiRoom.isShowed) aiRoom.hide();
if
(
to
==
backGroundPic
&&
backGroundPic
.
isShowed
==
false
)
backGroundPic
.
show
();
if
(
to
==
menu
&&
menu
.
isShowed
==
false
)
menu
.
show
();
...
...
@@ -768,7 +768,7 @@ public class Program : MonoBehaviour
if
(
to
==
selectServer
&&
selectServer
.
isShowed
==
false
)
selectServer
.
show
();
if
(
to
==
selectReplay
&&
selectReplay
.
isShowed
==
false
)
selectReplay
.
show
();
if
(
to
==
puzzleMode
&&
puzzleMode
.
isShowed
==
false
)
puzzleMode
.
show
();
if
(
to
==
aiRoom
&&
aiRoom
.
isShowed
==
false
)
aiRoom
.
show
();
//
if (to == aiRoom && aiRoom.isShowed == false) aiRoom.show();
}
#
endregion
...
...
Assets/SibylSystem/Room/AIRoom.cs
View file @
f35f6b22
using
System
;
using
System.IO
;
using
Random
=
UnityEngine
.
Random
;
public
class
AIRoom
:
WindowServantSP
{
private
PrecyOcg
precy
;
public
void
launch
(
string
playerDek
,
string
aiDeck
,
string
aiScript
,
bool
playerGo
,
bool
suffle
,
int
life
,
bool
god
,
int
rule
)
{
if
(
precy
!=
null
)
precy
.
dispose
();
precy
=
new
PrecyOcg
();
precy
.
startAI
(
playerDek
,
aiDeck
,
aiScript
,
playerGo
,
suffle
,
life
,
god
,
rule
);
RMSshow_none
(
InterString
.
Get
(
"AI模式还在开发中,您在AI模式下遇到的BUG不会在联机的时候出现。"
));
}
#
region
ui
private
UIselectableList
superScrollView
;
private
readonly
string
sort
=
"sortByTimeDeck"
;
private
string
suiji
=
""
;
private
UIPopupList
list_aideck
;
private
UIPopupList
list_airank
;
public
override
void
initialize
()
{
suiji
=
InterString
.
Get
(
"随机卡组"
);
SetWindow
(
Program
.
I
().
new_ui_aiRoom
);
superScrollView
=
gameObject
.
GetComponentInChildren
<
UIselectableList
>();
superScrollView
.
selectedAction
=
onSelected
;
list_aideck
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"aideck_"
);
list_airank
=
UIHelper
.
getByName
<
UIPopupList
>(
gameObject
,
"rank_"
);
list_aideck
.
value
=
Config
.
Get
(
"list_aideck"
,
suiji
);
list_airank
.
value
=
Config
.
Get
(
"list_airank"
,
"ai"
);
UIHelper
.
registEvent
(
gameObject
,
"aideck_"
,
onSave
);
UIHelper
.
registEvent
(
gameObject
,
"rank_"
,
onSave
);
UIHelper
.
registEvent
(
gameObject
,
"start_"
,
onStart
);
UIHelper
.
registEvent
(
gameObject
,
"exit_"
,
onClickExit
);
UIHelper
.
trySetLableText
(
gameObject
,
"percyHint"
,
InterString
.
Get
(
"人机模式"
));
superScrollView
.
install
();
SetActiveFalse
();
}
private
void
onSelected
()
{
Config
.
Set
(
"deckInUse"
,
superScrollView
.
selectedString
);
}
private
void
onSave
()
{
Config
.
Set
(
"list_aideck"
,
list_aideck
.
value
);
Config
.
Set
(
"list_airank"
,
list_airank
.
value
);
}
private
void
onClickExit
()
{
if
(
Program
.
exitOnReturn
)
Program
.
I
().
menu
.
onClickExit
();
else
Program
.
I
().
shiftToServant
(
Program
.
I
().
menu
);
}
private
void
onStart
()
{
if
(!
isShowed
)
return
;
var
l
=
8000
;
try
{
l
=
int
.
Parse
(
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"life_"
).
value
);
}
catch
(
Exception
)
{
}
var
aideck
=
""
;
if
(
Config
.
Get
(
"list_aideck"
,
suiji
)
==
suiji
)
aideck
=
"ai/ydk/"
+
list_aideck
.
items
[
Random
.
Range
(
1
,
list_aideck
.
items
.
Count
)]
+
".ydk"
;
else
aideck
=
"ai/ydk/"
+
Config
.
Get
(
"list_aideck"
,
suiji
)
+
".ydk"
;
launch
(
"deck/"
+
Config
.
Get
(
"deckInUse"
,
"miaowu"
)
+
".ydk"
,
aideck
,
"ai/"
+
Config
.
Get
(
"list_airank"
,
"ai"
)
+
".lua"
,
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"first_"
).
value
,
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"unrand_"
).
value
,
l
,
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"god_"
).
value
,
UIHelper
.
getByName
<
UIToggle
>(
gameObject
,
"mr4_"
).
value
?
4
:
3
);
}
private
void
printFile
()
{
var
deckInUse
=
Config
.
Get
(
"deckInUse"
,
"miaowu"
);
superScrollView
.
clear
();
var
fileInfos
=
new
DirectoryInfo
(
"deck"
).
GetFiles
();
if
(
Config
.
Get
(
sort
,
"1"
)
==
"1"
)
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareTime
);
else
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareName
);
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
==
deckInUse
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
!=
deckInUse
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
list_aideck
.
Clear
();
fileInfos
=
new
DirectoryInfo
(
"ai/ydk"
).
GetFiles
();
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareName
);
list_aideck
.
AddItem
(
suiji
);
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
list_aideck
.
AddItem
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
list_airank
.
Clear
();
fileInfos
=
new
DirectoryInfo
(
"ai"
).
GetFiles
();
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareName
);
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".lua"
)
list_airank
.
AddItem
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
}
public
override
void
show
()
{
base
.
show
();
printFile
();
superScrollView
.
selectedString
=
Config
.
Get
(
"deckInUse"
,
"miaowu"
);
superScrollView
.
toTop
();
Program
.
charge
();
}
#
endregion
}
\ No newline at end of file
// using System;
// using System.IO;
// using Random = UnityEngine.Random;
//
// public class AIRoom : WindowServantSP
// {
// private PrecyOcg precy;
//
// public void launch(string playerDek, string aiDeck, string aiScript, bool playerGo, bool suffle, int life, bool god,
// int rule)
// {
// if (precy != null) precy.dispose();
// precy = new PrecyOcg();
// precy.startAI(playerDek, aiDeck, aiScript, playerGo, suffle, life, god, rule);
// RMSshow_none(InterString.Get("AI模式还在开发中,您在AI模式下遇到的BUG不会在联机的时候出现。"));
// }
//
// #region ui
//
// private UIselectableList superScrollView;
// private readonly string sort = "sortByTimeDeck";
// private string suiji = "";
//
// private UIPopupList list_aideck;
// private UIPopupList list_airank;
//
// public override void initialize()
// {
// suiji = InterString.Get("随机卡组");
// SetWindow(Program.I().new_ui_aiRoom);
// superScrollView = gameObject.GetComponentInChildren<UIselectableList>();
// superScrollView.selectedAction = onSelected;
// list_aideck = UIHelper.getByName<UIPopupList>(gameObject, "aideck_");
// list_airank = UIHelper.getByName<UIPopupList>(gameObject, "rank_");
// list_aideck.value = Config.Get("list_aideck", suiji);
// list_airank.value = Config.Get("list_airank", "ai");
// UIHelper.registEvent(gameObject, "aideck_", onSave);
// UIHelper.registEvent(gameObject, "rank_", onSave);
// UIHelper.registEvent(gameObject, "start_", onStart);
// UIHelper.registEvent(gameObject, "exit_", onClickExit);
// UIHelper.trySetLableText(gameObject, "percyHint", InterString.Get("人机模式"));
// superScrollView.install();
// SetActiveFalse();
// }
//
// private void onSelected()
// {
// Config.Set("deckInUse", superScrollView.selectedString);
// }
//
// private void onSave()
// {
// Config.Set("list_aideck", list_aideck.value);
// Config.Set("list_airank", list_airank.value);
// }
//
// private void onClickExit()
// {
// if (Program.exitOnReturn)
// Program.I().menu.onClickExit();
// else
// Program.I().shiftToServant(Program.I().menu);
// }
//
// private void onStart()
// {
// if (!isShowed) return;
// var l = 8000;
// try
// {
// l = int.Parse(UIHelper.getByName<UIInput>(gameObject, "life_").value);
// }
// catch (Exception)
// {
// }
//
// var aideck = "";
// if (Config.Get("list_aideck", suiji) == suiji)
// aideck = "ai/ydk/" + list_aideck.items[Random.Range(1, list_aideck.items.Count)] + ".ydk";
// else
// aideck = "ai/ydk/" + Config.Get("list_aideck", suiji) + ".ydk";
// launch("deck/" + Config.Get("deckInUse", "miaowu") + ".ydk", aideck,
// "ai/" + Config.Get("list_airank", "ai") + ".lua", UIHelper.getByName<UIToggle>(gameObject, "first_").value,
// UIHelper.getByName<UIToggle>(gameObject, "unrand_").value, l,
// UIHelper.getByName<UIToggle>(gameObject, "god_").value,
// UIHelper.getByName<UIToggle>(gameObject, "mr4_").value ? 4 : 3);
// }
//
// private void printFile()
// {
// var deckInUse = Config.Get("deckInUse", "miaowu");
// superScrollView.clear();
// var fileInfos = new DirectoryInfo("deck").GetFiles();
// if (Config.Get(sort, "1") == "1")
// Array.Sort(fileInfos, UIHelper.CompareTime);
// else
// Array.Sort(fileInfos, UIHelper.CompareName);
// for (var i = 0; i < fileInfos.Length; i++)
// if (fileInfos[i].Name.Length > 4)
// if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk")
// if (fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4) == deckInUse)
// superScrollView.add(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4));
// for (var i = 0; i < fileInfos.Length; i++)
// if (fileInfos[i].Name.Length > 4)
// if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk")
// if (fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4) != deckInUse)
// superScrollView.add(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4));
// list_aideck.Clear();
// fileInfos = new DirectoryInfo("ai/ydk").GetFiles();
// Array.Sort(fileInfos, UIHelper.CompareName);
// list_aideck.AddItem(suiji);
// for (var i = 0; i < fileInfos.Length; i++)
// if (fileInfos[i].Name.Length > 4)
// if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".ydk")
// list_aideck.AddItem(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4));
// list_airank.Clear();
// fileInfos = new DirectoryInfo("ai").GetFiles();
// Array.Sort(fileInfos, UIHelper.CompareName);
// for (var i = 0; i < fileInfos.Length; i++)
// if (fileInfos[i].Name.Length > 4)
// if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".lua")
// list_airank.AddItem(fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4));
// }
//
// public override void show()
// {
// base.show();
// printFile();
// superScrollView.selectedString = Config.Get("deckInUse", "miaowu");
// superScrollView.toTop();
// Program.charge();
// }
//
// #endregion
// }
\ No newline at end of file
Assets/SibylSystem/Room/Room.cs
View file @
f35f6b22
...
...
@@ -9,7 +9,6 @@ using Object = UnityEngine.Object;
public
class
Room
:
WindowServantSP
{
private
readonly
string
sort
=
"sortByTimeDeck"
;
private
UIselectableList
superScrollView
;
public
override
void
initialize
()
...
...
@@ -32,23 +31,8 @@ public class Room : WindowServantSP
private
void
printFile
()
{
var
deckInUse
=
Config
.
Get
(
"deckInUse"
,
"wizard"
);
superScrollView
.
clear
();
var
fileInfos
=
new
DirectoryInfo
(
"deck"
).
GetFiles
();
if
(
Config
.
Get
(
sort
,
"1"
)
==
"1"
)
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareTime
);
else
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareName
);
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
==
deckInUse
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
!=
deckInUse
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
foreach
(
var
deck
in
UIHelper
.
GetDecks
())
superScrollView
.
add
(
deck
);
}
public
override
void
show
()
...
...
Assets/SibylSystem/SelectDeck/selectDeck.cs
View file @
f35f6b22
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
UnityEngine
;
using
YGOSharp
;
...
...
@@ -11,7 +12,6 @@ public class selectDeck : WindowServantSP
{
private
readonly
cardPicLoader
[]
quickCards
=
new
cardPicLoader
[
200
];
private
readonly
string
sort
=
"sortByTimeDeck"
;
private
UIDeckPanel
deckPanel
;
...
...
@@ -121,7 +121,9 @@ public class selectDeck : WindowServantSP
if
(
hashCode
==
"onNew"
)
try
{
File
.
Create
(
"deck/"
+
result
[
0
].
value
+
".ydk"
).
Close
();
var
path
=
$"deck/
{
result
[
0
].
value
}
.ydk"
;
Directory
.
CreateDirectory
(
Path
.
GetDirectoryName
(
path
)!);
File
.
Create
(
path
).
Close
();
RMSshow_none
(
InterString
.
Get
(
"「[?]」创建完毕。"
,
result
[
0
].
value
));
superScrollView
.
selectedString
=
result
[
0
].
value
;
printFile
();
...
...
@@ -147,7 +149,9 @@ public class selectDeck : WindowServantSP
if
(
hashCode
==
"onCopy"
)
try
{
File
.
Copy
(
"deck/"
+
superScrollView
.
selectedString
+
".ydk"
,
"deck/"
+
result
[
0
].
value
+
".ydk"
);
var
path
=
$"deck/
{
result
[
0
].
value
}
.ydk"
;
Directory
.
CreateDirectory
(
Path
.
GetDirectoryName
(
path
)!);
File
.
Copy
(
"deck/"
+
superScrollView
.
selectedString
+
".ydk"
,
path
);
RMSshow_none
(
InterString
.
Get
(
"「[?]」复制完毕。"
,
superScrollView
.
selectedString
));
superScrollView
.
selectedString
=
result
[
0
].
value
;
printFile
();
...
...
@@ -160,7 +164,9 @@ public class selectDeck : WindowServantSP
if
(
hashCode
==
"onRename"
)
try
{
File
.
Move
(
"deck/"
+
superScrollView
.
selectedString
+
".ydk"
,
"deck/"
+
result
[
0
].
value
+
".ydk"
);
var
path
=
$"deck/
{
result
[
0
].
value
}
.ydk"
;
Directory
.
CreateDirectory
(
Path
.
GetDirectoryName
(
path
)!);
File
.
Move
(
"deck/"
+
superScrollView
.
selectedString
+
".ydk"
,
path
);
RMSshow_none
(
InterString
.
Get
(
"「[?]」重命名完毕。"
,
superScrollView
.
selectedString
));
superScrollView
.
selectedString
=
result
[
0
].
value
;
printFile
();
...
...
@@ -233,7 +239,7 @@ public class selectDeck : WindowServantSP
private
void
setSortLable
()
{
if
(
Config
.
Get
(
sort
,
"1"
)
==
"1"
)
if
(
Config
.
Get
(
UIHelper
.
sort
,
"1"
)
==
"1"
)
UIHelper
.
trySetLableText
(
gameObject
,
"sort_"
,
InterString
.
Get
(
"时间排序"
));
else
UIHelper
.
trySetLableText
(
gameObject
,
"sort_"
,
InterString
.
Get
(
"名称排序"
));
...
...
@@ -241,10 +247,10 @@ public class selectDeck : WindowServantSP
private
void
onSort
()
{
if
(
Config
.
Get
(
sort
,
"1"
)
==
"1"
)
Config
.
Set
(
sort
,
"0"
);
if
(
Config
.
Get
(
UIHelper
.
sort
,
"1"
)
==
"1"
)
Config
.
Set
(
UIHelper
.
sort
,
"0"
);
else
Config
.
Set
(
sort
,
"1"
);
Config
.
Set
(
UIHelper
.
sort
,
"1"
);
setSortLable
();
printFile
();
}
...
...
@@ -377,29 +383,9 @@ public class selectDeck : WindowServantSP
private
void
printFile
()
{
var
deckInUse
=
Config
.
Get
(
"deckInUse"
,
"miaowu"
);
superScrollView
.
clear
();
var
fileInfos
=
new
DirectoryInfo
(
"deck"
).
GetFiles
();
if
(
Config
.
Get
(
sort
,
"1"
)
==
"1"
)
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareTime
);
else
Array
.
Sort
(
fileInfos
,
UIHelper
.
CompareName
);
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
==
deckInUse
)
if
(
searchInput
.
value
==
""
||
Regex
.
Replace
(
fileInfos
[
i
].
Name
,
searchInput
.
value
,
"miaowu"
,
RegexOptions
.
IgnoreCase
)
!=
fileInfos
[
i
].
Name
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
for
(
var
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
if
(
fileInfos
[
i
].
Name
.
Length
>
4
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
fileInfos
[
i
].
Name
.
Length
-
4
,
4
)
==
".ydk"
)
if
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
)
!=
deckInUse
)
if
(
searchInput
.
value
==
""
||
Regex
.
Replace
(
fileInfos
[
i
].
Name
,
searchInput
.
value
,
"miaowu"
,
RegexOptions
.
IgnoreCase
)
!=
fileInfos
[
i
].
Name
)
superScrollView
.
add
(
fileInfos
[
i
].
Name
.
Substring
(
0
,
fileInfos
[
i
].
Name
.
Length
-
4
));
foreach
(
var
deck
in
UIHelper
.
GetDecks
(
searchInput
.
value
))
superScrollView
.
add
(
deck
);
if
(
superScrollView
.
Selected
()
==
false
)
superScrollView
.
selectTop
();
}
...
...
Assets/SibylSystem/precy.cs
View file @
f35f6b22
...
...
@@ -62,28 +62,28 @@ public class PrecyOcg
}
}
public
void
startAI
(
string
playerDek
,
string
aiDeck
,
string
aiScript
,
bool
playerGo
,
bool
unrand
,
int
life
,
bool
god
,
int
rule
)
{
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
{
Program
.
I
().
room
.
mode
=
0
;
Program
.
I
().
ocgcore
.
MasterRule
=
rule
;
godMode
=
god
;
prepareOcgcore
();
Program
.
I
().
ocgcore
.
lpLimit
=
life
;
Program
.
I
().
ocgcore
.
isFirst
=
playerGo
;
Program
.
I
().
ocgcore
.
returnServant
=
Program
.
I
().
aiRoom
;
if
(!
ygopro
.
startAI
(
playerDek
,
aiDeck
,
aiScript
,
playerGo
,
unrand
,
life
,
god
,
rule
))
{
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"游戏内部出错,请重试。"
));
return
;
}
//Config.ClientVersion = 0x233c;
Program
.
I
().
shiftToServant
(
Program
.
I
().
ocgcore
);
}
}
//
public void startAI(string playerDek, string aiDeck, string aiScript, bool playerGo, bool unrand, int life,
//
bool god, int rule)
//
{
//
if (Program.I().ocgcore.isShowed == false)
//
{
//
Program.I().room.mode = 0;
//
Program.I().ocgcore.MasterRule = rule;
//
godMode = god;
//
prepareOcgcore();
//
Program.I().ocgcore.lpLimit = life;
//
Program.I().ocgcore.isFirst = playerGo;
//
Program.I().ocgcore.returnServant = Program.I().aiRoom;
//
if (!ygopro.startAI(playerDek, aiDeck, aiScript, playerGo, unrand, life, god, rule))
//
{
//
Program.I().cardDescription.RMSshow_none(InterString.Get("游戏内部出错,请重试。"));
//
return;
//
}
//
//
//Config.ClientVersion = 0x233c;
//
Program.I().shiftToServant(Program.I().ocgcore);
//
}
//
}
private
void
prepareOcgcore
()
{
...
...
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