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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
MyCard
YGOProUnity_V2
Commits
6dc291c3
Commit
6dc291c3
authored
Apr 04, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update SelectUnselectCard (thanks to edo9300)
support cancel selected cards
parent
4c53872e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+24
-21
No files found.
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
6dc291c3
...
...
@@ -3401,8 +3401,8 @@ public class Ocgcore : ServantWithCardDescription
cancalable
=
(
r
.
ReadByte
()
!=
0
)
||
finishable
;
ES_min
=
r
.
ReadByte
();
ES_max
=
r
.
ReadByte
();
ES_min = finishable ? 0 : 1; // SelectUnselectCard can actually always select 1 card
ES_max = 1; // SelectUnselectCard can actually always select 1 card
//
ES_min = finishable ? 0 : 1; // SelectUnselectCard can actually always select 1 card
//
ES_max = 1; // SelectUnselectCard can actually always select 1 card
ES_level
=
0
;
count
=
r
.
ReadByte
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
...
...
@@ -3419,12 +3419,13 @@ public class Ocgcore : ServantWithCardDescription
allCardsInSelectMessage
.
Add
(
card
);
}
}
count = r.ReadByte();
for (int i = 0; i < count; i++)
cardsSelected
.
Clear
();
int
count2
=
r
.
ReadByte
();
for
(
int
i
=
count
;
i
<
count
+
count2
;
i
++)
{
code
=
r
.
ReadInt32
();
gps
=
r
.
ReadGPS
();
/*
card = GCS_cardGet(gps, false);
card
=
GCS_cardGet
(
gps
,
false
);
if
(
card
!=
null
)
{
card
.
set_code
(
code
);
...
...
@@ -3432,13 +3433,19 @@ public class Ocgcore : ServantWithCardDescription
card
.
forSelect
=
true
;
card
.
selectPtr
=
i
;
allCardsInSelectMessage
.
Add
(
card
);
}*/
cardsSelected
.
Add
(
card
);
}
}
if
(
cancalable
&&
!
finishable
)
{
gameInfo
.
addHashedButton
(
"cancleSelected"
,
-
1
,
superButtonType
.
no
,
InterString
.
Get
(
"取消选择@ui"
));
}
if
(
finishable
)
{
gameInfo
.
addHashedButton
(
"sendSelected"
,
0
,
superButtonType
.
yes
,
InterString
.
Get
(
"完成选择@ui"
));
}
realizeCardsForSelect
();
cardsSelected
.
Clear
();
if
(
ES_selectHint
!=
""
)
{
gameField
.
setHint
(
ES_selectHint
+
" "
+
ES_min
.
ToString
()
+
"-"
+
ES_max
.
ToString
());
...
...
@@ -5648,7 +5655,6 @@ public class Ocgcore : ServantWithCardDescription
}
break
;
case
GameMessage
.
SelectCard
:
case GameMessage.SelectUnselectCard:
if
(
cardsSelectable
.
Count
<=
ES_min
)
{
autoSendCards
();
...
...
@@ -5820,18 +5826,6 @@ public class Ocgcore : ServantWithCardDescription
real_send
=
true
;
}
}
if (currentMessage == GameMessage.SelectUnselectCard)
{
if (cardsSelected.Count >= ES_min)
{
sendable = true;
}
if (cardsSelected.Count == ES_max || cardsSelected.Count == cardsSelectable.Count)
{
sendable = true;
real_send = true;
}
}
if
(
currentMessage
==
GameMessage
.
SelectTribute
)
{
int
all
=
0
;
...
...
@@ -5878,7 +5872,7 @@ public class Ocgcore : ServantWithCardDescription
}
}
}
else
else
if
(
currentMessage
!=
GameMessage
.
SelectUnselectCard
)
{
gameInfo
.
removeHashedButton
(
"sendSelected"
);
}
...
...
@@ -8485,7 +8479,6 @@ public class Ocgcore : ServantWithCardDescription
}
break
;
case
GameMessage
.
SelectCard
:
case GameMessage.SelectUnselectCard:
case
GameMessage
.
SelectTribute
:
case
GameMessage
.
SelectSum
:
if
(
card
.
forSelect
)
...
...
@@ -8526,6 +8519,16 @@ public class Ocgcore : ServantWithCardDescription
realizeCardsForSelect
();
}
break
;
case
GameMessage
.
SelectUnselectCard
:
if
(
card
.
forSelect
)
{
cardsSelected
.
Add
(
card
);
gameInfo
.
removeHashedButton
(
"sendSelected"
);
sendSelectedCards
();
realize
();
toNearest
();
}
break
;
case
GameMessage
.
SelectChain
:
if
(
card
.
forSelect
)
{
...
...
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