Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
BBeretta
Neos
Commits
6f35edc4
Commit
6f35edc4
authored
May 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'optimize/store/modal' into 'main'
Optimize/store/modal See merge request
!179
parents
3803129a
1f953299
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
440 additions
and
1137 deletions
+440
-1137
neos-protobuf
neos-protobuf
+1
-1
src/api/ocgcore/idl/ocgcore.ts
src/api/ocgcore/idl/ocgcore.ts
+97
-279
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
+6
-14
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectMulti.ts
...cgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectMulti.ts
+1
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectSingle.ts
...gcore/ocgAdapter/ctos/ctosGameMsgResponse/selectSingle.ts
+1
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
...ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
+0
-17
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+4
-22
src/service/duel/selectCard.ts
src/service/duel/selectCard.ts
+7
-9
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+9
-11
src/service/duel/selectEffectYn.ts
src/service/duel/selectEffectYn.ts
+3
-11
src/service/duel/selectSum.ts
src/service/duel/selectSum.ts
+12
-14
src/service/duel/selectTribute.ts
src/service/duel/selectTribute.ts
+9
-18
src/service/duel/selectUnselectCard.ts
src/service/duel/selectUnselectCard.ts
+13
-28
src/stores/matStore/methods/cardZoneToChinese.ts
src/stores/matStore/methods/cardZoneToChinese.ts
+0
-42
src/stores/matStore/methods/fetchCheckCardMeta.ts
src/stores/matStore/methods/fetchCheckCardMeta.ts
+22
-74
src/stores/matStore/methods/index.ts
src/stores/matStore/methods/index.ts
+0
-1
src/stores/messageStore/methods/clearSelectActions.ts
src/stores/messageStore/methods/clearSelectActions.ts
+18
-0
src/stores/messageStore/methods/fetchCheckCardMetasV2.ts
src/stores/messageStore/methods/fetchCheckCardMetasV2.ts
+0
-44
src/stores/messageStore/methods/fetchCheckCardMetasV3.ts
src/stores/messageStore/methods/fetchCheckCardMetasV3.ts
+0
-49
src/stores/messageStore/methods/index.ts
src/stores/messageStore/methods/index.ts
+1
-2
src/stores/messageStore/store.ts
src/stores/messageStore/store.ts
+7
-15
src/stores/messageStore/types.ts
src/stores/messageStore/types.ts
+31
-58
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-6
src/ui/Duel/Message/CheckCardModal.tsx
src/ui/Duel/Message/CheckCardModal.tsx
+0
-168
src/ui/Duel/Message/CheckCardModalV2.tsx
src/ui/Duel/Message/CheckCardModalV2.tsx
+0
-125
src/ui/Duel/Message/CheckCardModalV3.tsx
src/ui/Duel/Message/CheckCardModalV3.tsx
+0
-124
src/ui/Duel/Message/SelectActionsModal.tsx
src/ui/Duel/Message/SelectActionsModal.tsx
+195
-0
src/ui/Duel/Message/index.ts
src/ui/Duel/Message/index.ts
+1
-3
No files found.
neos-protobuf
@
be66d514
Subproject commit
1648b05d2e0bf0fc84c9e98104b8d9ca6a014c1
a
Subproject commit
be66d514be6d1224163f55bca85dc361d0c9fe6
a
src/api/ocgcore/idl/ocgcore.ts
View file @
6f35edc4
...
@@ -2668,7 +2668,7 @@ export namespace ygopro {
...
@@ -2668,7 +2668,7 @@ export namespace ygopro {
}
}
}
}
export
class
CtosGameMsgResponse
extends
pb_1
.
Message
{
export
class
CtosGameMsgResponse
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
]];
#
one_of_decls
:
number
[][]
=
[[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]];
constructor
(
constructor
(
data
?:
data
?:
|
any
[]
|
any
[]
...
@@ -2676,143 +2676,120 @@ export namespace ygopro {
...
@@ -2676,143 +2676,120 @@ export namespace ygopro {
|
{
|
{
select_idle_cmd
?:
CtosGameMsgResponse
.
SelectIdleCmdResponse
;
select_idle_cmd
?:
CtosGameMsgResponse
.
SelectIdleCmdResponse
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
CtosGameMsgResponse
.
SelectPlaceResponse
;
select_place
?:
CtosGameMsgResponse
.
SelectPlaceResponse
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
CtosGameMsgResponse
.
SelectCard
Response
;
select_
multi
?:
CtosGameMsgResponse
.
SelectMulti
Response
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
CtosGameMsgResponse
.
SelectChain
Response
;
select_
single
?:
CtosGameMsgResponse
.
SelectSingle
Response
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
CtosGameMsgResponse
.
SelectEffectYnResponse
;
select_effect_yn
?:
CtosGameMsgResponse
.
SelectEffectYnResponse
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
CtosGameMsgResponse
.
SelectPositionResponse
;
select_position
?:
CtosGameMsgResponse
.
SelectPositionResponse
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
CtosGameMsgResponse
.
SelectOptionResponse
;
select_option
?:
CtosGameMsgResponse
.
SelectOptionResponse
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
CtosGameMsgResponse
.
SelectBattleCmdResponse
;
select_battle_cmd
?:
CtosGameMsgResponse
.
SelectBattleCmdResponse
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
CtosGameMsgResponse
.
SelectUnselectCardResponse
;
select_counter_response
?:
never
;
sort_card
?:
never
;
}
|
{
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_card
?:
never
;
select_chain
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
CtosGameMsgResponse
.
SelectCounterResponse
;
select_counter_response
?:
CtosGameMsgResponse
.
SelectCounterResponse
;
sort_card
?:
never
;
sort_card
?:
never
;
}
}
|
{
|
{
select_idle_cmd
?:
never
;
select_idle_cmd
?:
never
;
select_place
?:
never
;
select_place
?:
never
;
select_
card
?:
never
;
select_
multi
?:
never
;
select_
chain
?:
never
;
select_
single
?:
never
;
select_effect_yn
?:
never
;
select_effect_yn
?:
never
;
select_position
?:
never
;
select_position
?:
never
;
select_option
?:
never
;
select_option
?:
never
;
select_battle_cmd
?:
never
;
select_battle_cmd
?:
never
;
select_unselect_card
?:
never
;
select_counter_response
?:
never
;
select_counter_response
?:
never
;
sort_card
?:
CtosGameMsgResponse
.
SortCardResponse
;
sort_card
?:
CtosGameMsgResponse
.
SortCardResponse
;
}
}
...
@@ -2834,11 +2811,11 @@ export namespace ygopro {
...
@@ -2834,11 +2811,11 @@ export namespace ygopro {
if
(
"
select_place
"
in
data
&&
data
.
select_place
!=
undefined
)
{
if
(
"
select_place
"
in
data
&&
data
.
select_place
!=
undefined
)
{
this
.
select_place
=
data
.
select_place
;
this
.
select_place
=
data
.
select_place
;
}
}
if
(
"
select_
card
"
in
data
&&
data
.
select_card
!=
undefined
)
{
if
(
"
select_
multi
"
in
data
&&
data
.
select_multi
!=
undefined
)
{
this
.
select_
card
=
data
.
select_card
;
this
.
select_
multi
=
data
.
select_multi
;
}
}
if
(
"
select_
chain
"
in
data
&&
data
.
select_chain
!=
undefined
)
{
if
(
"
select_
single
"
in
data
&&
data
.
select_single
!=
undefined
)
{
this
.
select_
chain
=
data
.
select_chain
;
this
.
select_
single
=
data
.
select_single
;
}
}
if
(
"
select_effect_yn
"
in
data
&&
data
.
select_effect_yn
!=
undefined
)
{
if
(
"
select_effect_yn
"
in
data
&&
data
.
select_effect_yn
!=
undefined
)
{
this
.
select_effect_yn
=
data
.
select_effect_yn
;
this
.
select_effect_yn
=
data
.
select_effect_yn
;
...
@@ -2855,12 +2832,6 @@ export namespace ygopro {
...
@@ -2855,12 +2832,6 @@ export namespace ygopro {
)
{
)
{
this
.
select_battle_cmd
=
data
.
select_battle_cmd
;
this
.
select_battle_cmd
=
data
.
select_battle_cmd
;
}
}
if
(
"
select_unselect_card
"
in
data
&&
data
.
select_unselect_card
!=
undefined
)
{
this
.
select_unselect_card
=
data
.
select_unselect_card
;
}
if
(
if
(
"
select_counter_response
"
in
data
&&
"
select_counter_response
"
in
data
&&
data
.
select_counter_response
!=
undefined
data
.
select_counter_response
!=
undefined
...
@@ -2898,30 +2869,30 @@ export namespace ygopro {
...
@@ -2898,30 +2869,30 @@ export namespace ygopro {
get
has_select_place
()
{
get
has_select_place
()
{
return
pb_1
.
Message
.
getField
(
this
,
2
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
2
)
!=
null
;
}
}
get
select_
card
()
{
get
select_
multi
()
{
return
pb_1
.
Message
.
getWrapperField
(
return
pb_1
.
Message
.
getWrapperField
(
this
,
this
,
CtosGameMsgResponse
.
Select
Card
Response
,
CtosGameMsgResponse
.
Select
Multi
Response
,
3
3
)
as
CtosGameMsgResponse
.
Select
Card
Response
;
)
as
CtosGameMsgResponse
.
Select
Multi
Response
;
}
}
set
select_
card
(
value
:
CtosGameMsgResponse
.
SelectCard
Response
)
{
set
select_
multi
(
value
:
CtosGameMsgResponse
.
SelectMulti
Response
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
3
,
this
.
#
one_of_decls
[
0
],
value
);
pb_1
.
Message
.
setOneofWrapperField
(
this
,
3
,
this
.
#
one_of_decls
[
0
],
value
);
}
}
get
has_select_
card
()
{
get
has_select_
multi
()
{
return
pb_1
.
Message
.
getField
(
this
,
3
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
3
)
!=
null
;
}
}
get
select_
chain
()
{
get
select_
single
()
{
return
pb_1
.
Message
.
getWrapperField
(
return
pb_1
.
Message
.
getWrapperField
(
this
,
this
,
CtosGameMsgResponse
.
Select
Chain
Response
,
CtosGameMsgResponse
.
Select
Single
Response
,
4
4
)
as
CtosGameMsgResponse
.
Select
Chain
Response
;
)
as
CtosGameMsgResponse
.
Select
Single
Response
;
}
}
set
select_
chain
(
value
:
CtosGameMsgResponse
.
SelectChain
Response
)
{
set
select_
single
(
value
:
CtosGameMsgResponse
.
SelectSingle
Response
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
4
,
this
.
#
one_of_decls
[
0
],
value
);
pb_1
.
Message
.
setOneofWrapperField
(
this
,
4
,
this
.
#
one_of_decls
[
0
],
value
);
}
}
get
has_select_
chain
()
{
get
has_select_
single
()
{
return
pb_1
.
Message
.
getField
(
this
,
4
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
4
)
!=
null
;
}
}
get
select_effect_yn
()
{
get
select_effect_yn
()
{
...
@@ -2976,48 +2947,33 @@ export namespace ygopro {
...
@@ -2976,48 +2947,33 @@ export namespace ygopro {
get
has_select_battle_cmd
()
{
get
has_select_battle_cmd
()
{
return
pb_1
.
Message
.
getField
(
this
,
8
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
8
)
!=
null
;
}
}
get
select_unselect_card
()
{
return
pb_1
.
Message
.
getWrapperField
(
this
,
CtosGameMsgResponse
.
SelectUnselectCardResponse
,
9
)
as
CtosGameMsgResponse
.
SelectUnselectCardResponse
;
}
set
select_unselect_card
(
value
:
CtosGameMsgResponse
.
SelectUnselectCardResponse
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
9
,
this
.
#
one_of_decls
[
0
],
value
);
}
get
has_select_unselect_card
()
{
return
pb_1
.
Message
.
getField
(
this
,
9
)
!=
null
;
}
get
select_counter_response
()
{
get
select_counter_response
()
{
return
pb_1
.
Message
.
getWrapperField
(
return
pb_1
.
Message
.
getWrapperField
(
this
,
this
,
CtosGameMsgResponse
.
SelectCounterResponse
,
CtosGameMsgResponse
.
SelectCounterResponse
,
10
9
)
as
CtosGameMsgResponse
.
SelectCounterResponse
;
)
as
CtosGameMsgResponse
.
SelectCounterResponse
;
}
}
set
select_counter_response
(
set
select_counter_response
(
value
:
CtosGameMsgResponse
.
SelectCounterResponse
value
:
CtosGameMsgResponse
.
SelectCounterResponse
)
{
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
10
,
this
.
#
one_of_decls
[
0
],
value
);
pb_1
.
Message
.
setOneofWrapperField
(
this
,
9
,
this
.
#
one_of_decls
[
0
],
value
);
}
}
get
has_select_counter_response
()
{
get
has_select_counter_response
()
{
return
pb_1
.
Message
.
getField
(
this
,
10
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
9
)
!=
null
;
}
}
get
sort_card
()
{
get
sort_card
()
{
return
pb_1
.
Message
.
getWrapperField
(
return
pb_1
.
Message
.
getWrapperField
(
this
,
this
,
CtosGameMsgResponse
.
SortCardResponse
,
CtosGameMsgResponse
.
SortCardResponse
,
1
1
1
0
)
as
CtosGameMsgResponse
.
SortCardResponse
;
)
as
CtosGameMsgResponse
.
SortCardResponse
;
}
}
set
sort_card
(
value
:
CtosGameMsgResponse
.
SortCardResponse
)
{
set
sort_card
(
value
:
CtosGameMsgResponse
.
SortCardResponse
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
1
1
,
this
.
#
one_of_decls
[
0
],
value
);
pb_1
.
Message
.
setOneofWrapperField
(
this
,
1
0
,
this
.
#
one_of_decls
[
0
],
value
);
}
}
get
has_sort_card
()
{
get
has_sort_card
()
{
return
pb_1
.
Message
.
getField
(
this
,
1
1
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
1
0
)
!=
null
;
}
}
get
gameMsgResponse
()
{
get
gameMsgResponse
()
{
const
cases
:
{
const
cases
:
{
...
@@ -3025,31 +2981,29 @@ export namespace ygopro {
...
@@ -3025,31 +2981,29 @@ export namespace ygopro {
|
"
none
"
|
"
none
"
|
"
select_idle_cmd
"
|
"
select_idle_cmd
"
|
"
select_place
"
|
"
select_place
"
|
"
select_
card
"
|
"
select_
multi
"
|
"
select_
chain
"
|
"
select_
single
"
|
"
select_effect_yn
"
|
"
select_effect_yn
"
|
"
select_position
"
|
"
select_position
"
|
"
select_option
"
|
"
select_option
"
|
"
select_battle_cmd
"
|
"
select_battle_cmd
"
|
"
select_unselect_card
"
|
"
select_counter_response
"
|
"
select_counter_response
"
|
"
sort_card
"
;
|
"
sort_card
"
;
}
=
{
}
=
{
0
:
"
none
"
,
0
:
"
none
"
,
1
:
"
select_idle_cmd
"
,
1
:
"
select_idle_cmd
"
,
2
:
"
select_place
"
,
2
:
"
select_place
"
,
3
:
"
select_
card
"
,
3
:
"
select_
multi
"
,
4
:
"
select_
chain
"
,
4
:
"
select_
single
"
,
5
:
"
select_effect_yn
"
,
5
:
"
select_effect_yn
"
,
6
:
"
select_position
"
,
6
:
"
select_position
"
,
7
:
"
select_option
"
,
7
:
"
select_option
"
,
8
:
"
select_battle_cmd
"
,
8
:
"
select_battle_cmd
"
,
9
:
"
select_unselect_card
"
,
9
:
"
select_counter_response
"
,
10
:
"
select_counter_response
"
,
10
:
"
sort_card
"
,
11
:
"
sort_card
"
,
};
};
return
cases
[
return
cases
[
pb_1
.
Message
.
computeOneofCase
(
this
,
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
])
pb_1
.
Message
.
computeOneofCase
(
this
,
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
])
];
];
}
}
static
fromObject
(
data
:
{
static
fromObject
(
data
:
{
...
@@ -3059,11 +3013,11 @@ export namespace ygopro {
...
@@ -3059,11 +3013,11 @@ export namespace ygopro {
select_place
?:
ReturnType
<
select_place
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectPlaceResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectPlaceResponse
.
prototype
.
toObject
>
;
>
;
select_
card
?:
ReturnType
<
select_
multi
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
Select
Card
Response
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
Select
Multi
Response
.
prototype
.
toObject
>
;
>
;
select_
chain
?:
ReturnType
<
select_
single
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
Select
Chain
Response
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
Select
Single
Response
.
prototype
.
toObject
>
;
>
;
select_effect_yn
?:
ReturnType
<
select_effect_yn
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectEffectYnResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectEffectYnResponse
.
prototype
.
toObject
...
@@ -3077,9 +3031,6 @@ export namespace ygopro {
...
@@ -3077,9 +3031,6 @@ export namespace ygopro {
select_battle_cmd
?:
ReturnType
<
select_battle_cmd
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectBattleCmdResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectBattleCmdResponse
.
prototype
.
toObject
>
;
>
;
select_unselect_card
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectUnselectCardResponse
.
prototype
.
toObject
>
;
select_counter_response
?:
ReturnType
<
select_counter_response
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectCounterResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectCounterResponse
.
prototype
.
toObject
>
;
>
;
...
@@ -3098,14 +3049,15 @@ export namespace ygopro {
...
@@ -3098,14 +3049,15 @@ export namespace ygopro {
message
.
select_place
=
message
.
select_place
=
CtosGameMsgResponse
.
SelectPlaceResponse
.
fromObject
(
data
.
select_place
);
CtosGameMsgResponse
.
SelectPlaceResponse
.
fromObject
(
data
.
select_place
);
}
}
if
(
data
.
select_card
!=
null
)
{
if
(
data
.
select_multi
!=
null
)
{
message
.
select_card
=
CtosGameMsgResponse
.
SelectCardResponse
.
fromObject
(
message
.
select_multi
=
data
.
select_card
CtosGameMsgResponse
.
SelectMultiResponse
.
fromObject
(
data
.
select_multi
);
);
}
}
if
(
data
.
select_chain
!=
null
)
{
if
(
data
.
select_single
!=
null
)
{
message
.
select_chain
=
message
.
select_single
=
CtosGameMsgResponse
.
SelectChainResponse
.
fromObject
(
data
.
select_chain
);
CtosGameMsgResponse
.
SelectSingleResponse
.
fromObject
(
data
.
select_single
);
}
}
if
(
data
.
select_effect_yn
!=
null
)
{
if
(
data
.
select_effect_yn
!=
null
)
{
message
.
select_effect_yn
=
message
.
select_effect_yn
=
...
@@ -3131,12 +3083,6 @@ export namespace ygopro {
...
@@ -3131,12 +3083,6 @@ export namespace ygopro {
data
.
select_battle_cmd
data
.
select_battle_cmd
);
);
}
}
if
(
data
.
select_unselect_card
!=
null
)
{
message
.
select_unselect_card
=
CtosGameMsgResponse
.
SelectUnselectCardResponse
.
fromObject
(
data
.
select_unselect_card
);
}
if
(
data
.
select_counter_response
!=
null
)
{
if
(
data
.
select_counter_response
!=
null
)
{
message
.
select_counter_response
=
message
.
select_counter_response
=
CtosGameMsgResponse
.
SelectCounterResponse
.
fromObject
(
CtosGameMsgResponse
.
SelectCounterResponse
.
fromObject
(
...
@@ -3158,11 +3104,11 @@ export namespace ygopro {
...
@@ -3158,11 +3104,11 @@ export namespace ygopro {
select_place
?:
ReturnType
<
select_place
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectPlaceResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectPlaceResponse
.
prototype
.
toObject
>
;
>
;
select_
card
?:
ReturnType
<
select_
multi
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
Select
Card
Response
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
Select
Multi
Response
.
prototype
.
toObject
>
;
>
;
select_
chain
?:
ReturnType
<
select_
single
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
Select
Chain
Response
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
Select
Single
Response
.
prototype
.
toObject
>
;
>
;
select_effect_yn
?:
ReturnType
<
select_effect_yn
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectEffectYnResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectEffectYnResponse
.
prototype
.
toObject
...
@@ -3176,9 +3122,6 @@ export namespace ygopro {
...
@@ -3176,9 +3122,6 @@ export namespace ygopro {
select_battle_cmd
?:
ReturnType
<
select_battle_cmd
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectBattleCmdResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectBattleCmdResponse
.
prototype
.
toObject
>
;
>
;
select_unselect_card
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectUnselectCardResponse
.
prototype
.
toObject
>
;
select_counter_response
?:
ReturnType
<
select_counter_response
?:
ReturnType
<
typeof
CtosGameMsgResponse
.
SelectCounterResponse
.
prototype
.
toObject
typeof
CtosGameMsgResponse
.
SelectCounterResponse
.
prototype
.
toObject
>
;
>
;
...
@@ -3192,11 +3135,11 @@ export namespace ygopro {
...
@@ -3192,11 +3135,11 @@ export namespace ygopro {
if
(
this
.
select_place
!=
null
)
{
if
(
this
.
select_place
!=
null
)
{
data
.
select_place
=
this
.
select_place
.
toObject
();
data
.
select_place
=
this
.
select_place
.
toObject
();
}
}
if
(
this
.
select_
card
!=
null
)
{
if
(
this
.
select_
multi
!=
null
)
{
data
.
select_
card
=
this
.
select_card
.
toObject
();
data
.
select_
multi
=
this
.
select_multi
.
toObject
();
}
}
if
(
this
.
select_
chain
!=
null
)
{
if
(
this
.
select_
single
!=
null
)
{
data
.
select_
chain
=
this
.
select_chain
.
toObject
();
data
.
select_
single
=
this
.
select_single
.
toObject
();
}
}
if
(
this
.
select_effect_yn
!=
null
)
{
if
(
this
.
select_effect_yn
!=
null
)
{
data
.
select_effect_yn
=
this
.
select_effect_yn
.
toObject
();
data
.
select_effect_yn
=
this
.
select_effect_yn
.
toObject
();
...
@@ -3210,9 +3153,6 @@ export namespace ygopro {
...
@@ -3210,9 +3153,6 @@ export namespace ygopro {
if
(
this
.
select_battle_cmd
!=
null
)
{
if
(
this
.
select_battle_cmd
!=
null
)
{
data
.
select_battle_cmd
=
this
.
select_battle_cmd
.
toObject
();
data
.
select_battle_cmd
=
this
.
select_battle_cmd
.
toObject
();
}
}
if
(
this
.
select_unselect_card
!=
null
)
{
data
.
select_unselect_card
=
this
.
select_unselect_card
.
toObject
();
}
if
(
this
.
select_counter_response
!=
null
)
{
if
(
this
.
select_counter_response
!=
null
)
{
data
.
select_counter_response
=
this
.
select_counter_response
.
toObject
();
data
.
select_counter_response
=
this
.
select_counter_response
.
toObject
();
}
}
...
@@ -3233,13 +3173,13 @@ export namespace ygopro {
...
@@ -3233,13 +3173,13 @@ export namespace ygopro {
writer
.
writeMessage
(
2
,
this
.
select_place
,
()
=>
writer
.
writeMessage
(
2
,
this
.
select_place
,
()
=>
this
.
select_place
.
serialize
(
writer
)
this
.
select_place
.
serialize
(
writer
)
);
);
if
(
this
.
has_select_
card
)
if
(
this
.
has_select_
multi
)
writer
.
writeMessage
(
3
,
this
.
select_
card
,
()
=>
writer
.
writeMessage
(
3
,
this
.
select_
multi
,
()
=>
this
.
select_
card
.
serialize
(
writer
)
this
.
select_
multi
.
serialize
(
writer
)
);
);
if
(
this
.
has_select_
chain
)
if
(
this
.
has_select_
single
)
writer
.
writeMessage
(
4
,
this
.
select_
chain
,
()
=>
writer
.
writeMessage
(
4
,
this
.
select_
single
,
()
=>
this
.
select_
chain
.
serialize
(
writer
)
this
.
select_
single
.
serialize
(
writer
)
);
);
if
(
this
.
has_select_effect_yn
)
if
(
this
.
has_select_effect_yn
)
writer
.
writeMessage
(
5
,
this
.
select_effect_yn
,
()
=>
writer
.
writeMessage
(
5
,
this
.
select_effect_yn
,
()
=>
...
@@ -3257,16 +3197,12 @@ export namespace ygopro {
...
@@ -3257,16 +3197,12 @@ export namespace ygopro {
writer
.
writeMessage
(
8
,
this
.
select_battle_cmd
,
()
=>
writer
.
writeMessage
(
8
,
this
.
select_battle_cmd
,
()
=>
this
.
select_battle_cmd
.
serialize
(
writer
)
this
.
select_battle_cmd
.
serialize
(
writer
)
);
);
if
(
this
.
has_select_unselect_card
)
writer
.
writeMessage
(
9
,
this
.
select_unselect_card
,
()
=>
this
.
select_unselect_card
.
serialize
(
writer
)
);
if
(
this
.
has_select_counter_response
)
if
(
this
.
has_select_counter_response
)
writer
.
writeMessage
(
10
,
this
.
select_counter_response
,
()
=>
writer
.
writeMessage
(
9
,
this
.
select_counter_response
,
()
=>
this
.
select_counter_response
.
serialize
(
writer
)
this
.
select_counter_response
.
serialize
(
writer
)
);
);
if
(
this
.
has_sort_card
)
if
(
this
.
has_sort_card
)
writer
.
writeMessage
(
1
1
,
this
.
sort_card
,
()
=>
writer
.
writeMessage
(
1
0
,
this
.
sort_card
,
()
=>
this
.
sort_card
.
serialize
(
writer
)
this
.
sort_card
.
serialize
(
writer
)
);
);
if
(
!
w
)
return
writer
.
getResultBuffer
();
if
(
!
w
)
return
writer
.
getResultBuffer
();
...
@@ -3300,18 +3236,18 @@ export namespace ygopro {
...
@@ -3300,18 +3236,18 @@ export namespace ygopro {
break
;
break
;
case
3
:
case
3
:
reader
.
readMessage
(
reader
.
readMessage
(
message
.
select_
card
,
message
.
select_
multi
,
()
=>
()
=>
(
message
.
select_
card
=
(
message
.
select_
multi
=
CtosGameMsgResponse
.
Select
Card
Response
.
deserialize
(
reader
))
CtosGameMsgResponse
.
Select
Multi
Response
.
deserialize
(
reader
))
);
);
break
;
break
;
case
4
:
case
4
:
reader
.
readMessage
(
reader
.
readMessage
(
message
.
select_
chain
,
message
.
select_
single
,
()
=>
()
=>
(
message
.
select_
chain
=
(
message
.
select_
single
=
CtosGameMsgResponse
.
Select
Chain
Response
.
deserialize
(
reader
))
CtosGameMsgResponse
.
Select
Single
Response
.
deserialize
(
reader
))
);
);
break
;
break
;
case
5
:
case
5
:
...
@@ -3353,16 +3289,6 @@ export namespace ygopro {
...
@@ -3353,16 +3289,6 @@ export namespace ygopro {
);
);
break
;
break
;
case
9
:
case
9
:
reader
.
readMessage
(
message
.
select_unselect_card
,
()
=>
(
message
.
select_unselect_card
=
CtosGameMsgResponse
.
SelectUnselectCardResponse
.
deserialize
(
reader
))
);
break
;
case
10
:
reader
.
readMessage
(
reader
.
readMessage
(
message
.
select_counter_response
,
message
.
select_counter_response
,
()
=>
()
=>
...
@@ -3370,7 +3296,7 @@ export namespace ygopro {
...
@@ -3370,7 +3296,7 @@ export namespace ygopro {
CtosGameMsgResponse
.
SelectCounterResponse
.
deserialize
(
reader
))
CtosGameMsgResponse
.
SelectCounterResponse
.
deserialize
(
reader
))
);
);
break
;
break
;
case
1
1
:
case
1
0
:
reader
.
readMessage
(
reader
.
readMessage
(
message
.
sort_card
,
message
.
sort_card
,
()
=>
()
=>
...
@@ -3602,7 +3528,7 @@ export namespace ygopro {
...
@@ -3602,7 +3528,7 @@ export namespace ygopro {
return
SelectPlaceResponse
.
deserialize
(
bytes
);
return
SelectPlaceResponse
.
deserialize
(
bytes
);
}
}
}
}
export
class
Select
Card
Response
extends
pb_1
.
Message
{
export
class
Select
Multi
Response
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
#
one_of_decls
:
number
[][]
=
[];
constructor
(
constructor
(
data
?:
data
?:
...
@@ -3634,8 +3560,8 @@ export namespace ygopro {
...
@@ -3634,8 +3560,8 @@ export namespace ygopro {
}
}
static
fromObject
(
data
:
{
static
fromObject
(
data
:
{
selected_ptrs
?:
number
[];
selected_ptrs
?:
number
[];
}):
Select
Card
Response
{
}):
Select
Multi
Response
{
const
message
=
new
Select
Card
Response
({});
const
message
=
new
Select
Multi
Response
({});
if
(
data
.
selected_ptrs
!=
null
)
{
if
(
data
.
selected_ptrs
!=
null
)
{
message
.
selected_ptrs
=
data
.
selected_ptrs
;
message
.
selected_ptrs
=
data
.
selected_ptrs
;
}
}
...
@@ -3660,12 +3586,12 @@ export namespace ygopro {
...
@@ -3660,12 +3586,12 @@ export namespace ygopro {
}
}
static
deserialize
(
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
Select
Card
Response
{
):
Select
Multi
Response
{
const
reader
=
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
Select
Card
Response
();
message
=
new
Select
Multi
Response
();
while
(
reader
.
nextField
())
{
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
switch
(
reader
.
getFieldNumber
())
{
...
@@ -3681,11 +3607,11 @@ export namespace ygopro {
...
@@ -3681,11 +3607,11 @@ export namespace ygopro {
serializeBinary
():
Uint8Array
{
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
return
this
.
serialize
();
}
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
Select
Card
Response
{
static
deserializeBinary
(
bytes
:
Uint8Array
):
Select
Multi
Response
{
return
Select
Card
Response
.
deserialize
(
bytes
);
return
Select
Multi
Response
.
deserialize
(
bytes
);
}
}
}
}
export
class
Select
Chain
Response
extends
pb_1
.
Message
{
export
class
Select
Single
Response
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
#
one_of_decls
:
number
[][]
=
[];
constructor
(
constructor
(
data
?:
data
?:
...
@@ -3715,8 +3641,8 @@ export namespace ygopro {
...
@@ -3715,8 +3641,8 @@ export namespace ygopro {
set
selected_ptr
(
value
:
number
)
{
set
selected_ptr
(
value
:
number
)
{
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
}
}
static
fromObject
(
data
:
{
selected_ptr
?:
number
}):
Select
Chain
Response
{
static
fromObject
(
data
:
{
selected_ptr
?:
number
}):
Select
Single
Response
{
const
message
=
new
Select
Chain
Response
({});
const
message
=
new
Select
Single
Response
({});
if
(
data
.
selected_ptr
!=
null
)
{
if
(
data
.
selected_ptr
!=
null
)
{
message
.
selected_ptr
=
data
.
selected_ptr
;
message
.
selected_ptr
=
data
.
selected_ptr
;
}
}
...
@@ -3740,12 +3666,12 @@ export namespace ygopro {
...
@@ -3740,12 +3666,12 @@ export namespace ygopro {
}
}
static
deserialize
(
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
Select
Chain
Response
{
):
Select
Single
Response
{
const
reader
=
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
Select
Chain
Response
();
message
=
new
Select
Single
Response
();
while
(
reader
.
nextField
())
{
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
switch
(
reader
.
getFieldNumber
())
{
...
@@ -3761,8 +3687,8 @@ export namespace ygopro {
...
@@ -3761,8 +3687,8 @@ export namespace ygopro {
serializeBinary
():
Uint8Array
{
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
return
this
.
serialize
();
}
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
Select
Chain
Response
{
static
deserializeBinary
(
bytes
:
Uint8Array
):
Select
Single
Response
{
return
Select
Chain
Response
.
deserialize
(
bytes
);
return
Select
Single
Response
.
deserialize
(
bytes
);
}
}
}
}
export
class
SelectEffectYnResponse
extends
pb_1
.
Message
{
export
class
SelectEffectYnResponse
extends
pb_1
.
Message
{
...
@@ -4094,114 +4020,6 @@ export namespace ygopro {
...
@@ -4094,114 +4020,6 @@ export namespace ygopro {
return
SelectBattleCmdResponse
.
deserialize
(
bytes
);
return
SelectBattleCmdResponse
.
deserialize
(
bytes
);
}
}
}
}
export
class
SelectUnselectCardResponse
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
|
any
[]
|
{
cancel_or_finish
?:
boolean
;
selected_ptr
?:
number
;
}
)
{
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
if
(
"
cancel_or_finish
"
in
data
&&
data
.
cancel_or_finish
!=
undefined
)
{
this
.
cancel_or_finish
=
data
.
cancel_or_finish
;
}
if
(
"
selected_ptr
"
in
data
&&
data
.
selected_ptr
!=
undefined
)
{
this
.
selected_ptr
=
data
.
selected_ptr
;
}
}
}
get
cancel_or_finish
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
1
,
false
)
as
boolean
;
}
set
cancel_or_finish
(
value
:
boolean
)
{
pb_1
.
Message
.
setField
(
this
,
1
,
value
);
}
get
selected_ptr
()
{
return
pb_1
.
Message
.
getFieldWithDefault
(
this
,
2
,
0
)
as
number
;
}
set
selected_ptr
(
value
:
number
)
{
pb_1
.
Message
.
setField
(
this
,
2
,
value
);
}
static
fromObject
(
data
:
{
cancel_or_finish
?:
boolean
;
selected_ptr
?:
number
;
}):
SelectUnselectCardResponse
{
const
message
=
new
SelectUnselectCardResponse
({});
if
(
data
.
cancel_or_finish
!=
null
)
{
message
.
cancel_or_finish
=
data
.
cancel_or_finish
;
}
if
(
data
.
selected_ptr
!=
null
)
{
message
.
selected_ptr
=
data
.
selected_ptr
;
}
return
message
;
}
toObject
()
{
const
data
:
{
cancel_or_finish
?:
boolean
;
selected_ptr
?:
number
;
}
=
{};
if
(
this
.
cancel_or_finish
!=
null
)
{
data
.
cancel_or_finish
=
this
.
cancel_or_finish
;
}
if
(
this
.
selected_ptr
!=
null
)
{
data
.
selected_ptr
=
this
.
selected_ptr
;
}
return
data
;
}
serialize
():
Uint8Array
;
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
this
.
cancel_or_finish
!=
false
)
writer
.
writeBool
(
1
,
this
.
cancel_or_finish
);
if
(
this
.
selected_ptr
!=
0
)
writer
.
writeInt32
(
2
,
this
.
selected_ptr
);
if
(
!
w
)
return
writer
.
getResultBuffer
();
}
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
SelectUnselectCardResponse
{
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
SelectUnselectCardResponse
();
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
case
1
:
message
.
cancel_or_finish
=
reader
.
readBool
();
break
;
case
2
:
message
.
selected_ptr
=
reader
.
readInt32
();
break
;
default
:
reader
.
skipField
();
}
}
return
message
;
}
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
SelectUnselectCardResponse
{
return
SelectUnselectCardResponse
.
deserialize
(
bytes
);
}
}
export
class
SelectCounterResponse
extends
pb_1
.
Message
{
export
class
SelectCounterResponse
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
#
one_of_decls
:
number
[][]
=
[];
constructor
(
constructor
(
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
6f35edc4
...
@@ -2,15 +2,14 @@ import { ygopro } from "../../../idl/ocgcore";
...
@@ -2,15 +2,14 @@ import { ygopro } from "../../../idl/ocgcore";
import
{
YgoProPacket
}
from
"
../../packet
"
;
import
{
YgoProPacket
}
from
"
../../packet
"
;
import
{
CTOS_RESPONSE
}
from
"
../../protoDecl
"
;
import
{
CTOS_RESPONSE
}
from
"
../../protoDecl
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectCardResponse
from
"
./selectCard
"
;
import
adaptSelectChainResponse
from
"
./selectChain
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
import
adaptSelectEffectYnResponse
from
"
./selectEffectYn
"
;
import
adaptSelectEffectYnResponse
from
"
./selectEffectYn
"
;
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectMultiResponse
from
"
./selectMulti
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectPositionResponse
from
"
./selectPosition
"
;
import
adaptSelectPositionResponse
from
"
./selectPosition
"
;
import
adaptSelect
UnselectCardResponse
from
"
./selectUnselectCard
"
;
import
adaptSelect
SingleResponse
from
"
./selectSingle
"
;
import
adaptSortCardResponse
from
"
./sortCard
"
;
import
adaptSortCardResponse
from
"
./sortCard
"
;
/*
/*
...
@@ -37,13 +36,13 @@ export default class CtosResponsePacket extends YgoProPacket {
...
@@ -37,13 +36,13 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
break
;
}
}
case
"
select_
card
"
:
{
case
"
select_
multi
"
:
{
extraData
=
adaptSelect
CardResponse
(
response
.
select_card
);
extraData
=
adaptSelect
MultiResponse
(
response
.
select_multi
);
break
;
break
;
}
}
case
"
select_
chain
"
:
{
case
"
select_
single
"
:
{
extraData
=
adaptSelect
ChainResponse
(
response
.
select_chain
);
extraData
=
adaptSelect
SingleResponse
(
response
.
select_single
);
break
;
break
;
}
}
...
@@ -67,13 +66,6 @@ export default class CtosResponsePacket extends YgoProPacket {
...
@@ -67,13 +66,6 @@ export default class CtosResponsePacket extends YgoProPacket {
break
;
break
;
}
}
case
"
select_unselect_card
"
:
{
extraData
=
adaptSelectUnselectCardResponse
(
response
.
select_unselect_card
);
break
;
}
case
"
select_counter_response
"
:
{
case
"
select_counter_response
"
:
{
extraData
=
adaptSelectCounterResponse
(
extraData
=
adaptSelectCounterResponse
(
response
.
select_counter_response
response
.
select_counter_response
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Card
.ts
→
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Multi
.ts
View file @
6f35edc4
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Card
Response
)
=>
{
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Multi
Response
)
=>
{
const
writer
=
new
BufferWriter
();
const
writer
=
new
BufferWriter
();
writer
.
writeUint8
(
response
.
selected_ptrs
.
length
);
writer
.
writeUint8
(
response
.
selected_ptrs
.
length
);
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Chain
.ts
→
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/select
Single
.ts
View file @
6f35edc4
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
...
@@ -2,7 +2,7 @@ import { BufferWriter } from "rust-src";
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Chain
Response
)
=>
{
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
Select
Single
Response
)
=>
{
const
writer
=
new
BufferWriter
();
const
writer
=
new
BufferWriter
();
writer
.
writeInt32
(
response
.
selected_ptr
);
writer
.
writeInt32
(
response
.
selected_ptr
);
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
deleted
100644 → 0
View file @
3803129a
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectUnselectCardResponse
)
=>
{
const
writer
=
new
BufferWriter
();
if
(
response
.
cancel_or_finish
)
{
writer
.
writeInt32
(
-
1
);
}
else
{
writer
.
writeUint8
(
1
);
writer
.
writeUint8
(
response
.
selected_ptr
);
}
return
writer
.
toArray
();
};
src/api/ocgcore/ocgHelper.ts
View file @
6f35edc4
...
@@ -172,10 +172,10 @@ export function sendSelectPlaceResponse(value: {
...
@@ -172,10 +172,10 @@ export function sendSelectPlaceResponse(value: {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
}
export
function
sendSelect
Card
Response
(
value
:
number
[])
{
export
function
sendSelect
Multi
Response
(
value
:
number
[])
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_
card
:
new
ygopro
.
CtosGameMsgResponse
.
SelectCard
Response
({
select_
multi
:
new
ygopro
.
CtosGameMsgResponse
.
SelectMulti
Response
({
selected_ptrs
:
value
,
selected_ptrs
:
value
,
}),
}),
}),
}),
...
@@ -185,10 +185,10 @@ export function sendSelectCardResponse(value: number[]) {
...
@@ -185,10 +185,10 @@ export function sendSelectCardResponse(value: number[]) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
}
export
function
sendSelect
Chain
Response
(
value
:
number
)
{
export
function
sendSelect
Single
Response
(
value
:
number
)
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_
chain
:
new
ygopro
.
CtosGameMsgResponse
.
SelectChain
Response
({
select_
single
:
new
ygopro
.
CtosGameMsgResponse
.
SelectSingle
Response
({
selected_ptr
:
value
,
selected_ptr
:
value
,
}),
}),
}),
}),
...
@@ -252,24 +252,6 @@ export function sendSelectBattleCmdResponse(value: number) {
...
@@ -252,24 +252,6 @@ export function sendSelectBattleCmdResponse(value: number) {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
}
export
function
sendSelectUnselectCardResponse
(
value
:
{
cancel_or_finish
?:
boolean
;
selected_ptr
?:
number
;
})
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
select_unselect_card
:
new
ygopro
.
CtosGameMsgResponse
.
SelectUnselectCardResponse
({
selected_ptr
:
value
.
selected_ptr
,
cancel_or_finish
:
value
.
cancel_or_finish
,
}),
}),
});
const
payload
=
new
GameMsgResponse
(
response
).
serialize
();
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelectCounterResponse
(
counts
:
number
[])
{
export
function
sendSelectCounterResponse
(
counts
:
number
[])
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
...
...
src/service/duel/selectCard.ts
View file @
6f35edc4
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
import
{
CardZoneToChinese
,
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
export
default
(
selectCard
:
MsgSelectCard
)
=>
{
export
default
(
selectCard
:
MsgSelectCard
)
=>
{
const
_player
=
selectCard
.
player
;
const
cancelable
=
selectCard
.
cancelable
;
const
_cancelable
=
selectCard
.
cancelable
;
// TODO: 处理可取消逻辑
const
min
=
selectCard
.
min
;
const
min
=
selectCard
.
min
;
const
max
=
selectCard
.
max
;
const
max
=
selectCard
.
max
;
const
cards
=
selectCard
.
cards
;
const
cards
=
selectCard
.
cards
;
// TODO: handle release_param
// TODO: handle release_param
messageStore
.
checkCardModal
.
selectM
in
=
min
;
messageStore
.
selectCardActions
.
m
in
=
min
;
messageStore
.
checkCardModal
.
selectM
ax
=
max
;
messageStore
.
selectCardActions
.
m
ax
=
max
;
messageStore
.
checkCardModal
.
onSubmit
=
"
sendSelectCardResponse
"
;
messageStore
.
selectCardActions
.
cancelAble
=
cancelable
;
for
(
const
card
of
cards
)
{
for
(
const
card
of
cards
)
{
const
tagName
=
CardZoneToChinese
(
card
.
location
.
location
);
fetchCheckCardMeta
({
fetchCheckCardMeta
(
card
.
location
.
location
,
{
code
:
card
.
code
,
code
:
card
.
code
,
location
:
card
.
location
,
location
:
card
.
location
,
response
:
card
.
response
,
response
:
card
.
response
,
});
});
}
}
messageStore
.
checkCardModal
.
isOpen
=
true
;
messageStore
.
selectCardActions
.
isOpen
=
true
;
};
};
src/service/duel/selectChain.ts
View file @
6f35edc4
import
{
sendSelect
Chain
Response
,
ygopro
}
from
"
@/api
"
;
import
{
sendSelect
Single
Response
,
ygopro
}
from
"
@/api
"
;
import
{
import
{
fetchCheckCardMeta
,
fetchCheckCardMeta
,
fetchSelectHintMeta
,
fetchSelectHintMeta
,
...
@@ -7,7 +7,6 @@ import {
...
@@ -7,7 +7,6 @@ import {
type
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
type
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
export
default
(
selectChain
:
MsgSelectChain
)
=>
{
export
default
(
selectChain
:
MsgSelectChain
)
=>
{
const
player
=
selectChain
.
player
;
const
spCount
=
selectChain
.
special_count
;
const
spCount
=
selectChain
.
special_count
;
const
forced
=
selectChain
.
forced
;
const
forced
=
selectChain
.
forced
;
const
hint0
=
selectChain
.
hint0
;
const
hint0
=
selectChain
.
hint0
;
...
@@ -50,7 +49,7 @@ export default (selectChain: MsgSelectChain) => {
...
@@ -50,7 +49,7 @@ export default (selectChain: MsgSelectChain) => {
switch
(
handle_flag
)
{
switch
(
handle_flag
)
{
case
0
:
{
case
0
:
{
// 直接回答
// 直接回答
sendSelect
Chain
Response
(
-
1
);
sendSelect
Single
Response
(
-
1
);
break
;
break
;
}
}
...
@@ -58,14 +57,13 @@ export default (selectChain: MsgSelectChain) => {
...
@@ -58,14 +57,13 @@ export default (selectChain: MsgSelectChain) => {
case
3
:
{
case
3
:
{
// 处理强制发动的卡
// 处理强制发动的卡
messageStore
.
checkCardModal
.
selectMin
=
1
;
messageStore
.
selectCardActions
.
isChain
=
true
;
messageStore
.
checkCardModal
.
selectMax
=
1
;
messageStore
.
selectCardActions
.
min
=
1
;
messageStore
.
checkCardModal
.
onSubmit
=
"
sendSelectChainResponse
"
;
messageStore
.
selectCardActions
.
max
=
1
;
messageStore
.
checkCardModal
.
cancelAble
=
!
forced
;
messageStore
.
selectCardActions
.
cancelAble
=
!
forced
;
messageStore
.
checkCardModal
.
cancelResponse
=
-
1
;
for
(
const
chain
of
chains
)
{
for
(
const
chain
of
chains
)
{
fetchCheckCardMeta
(
chain
.
location
.
location
,
{
fetchCheckCardMeta
({
code
:
chain
.
code
,
code
:
chain
.
code
,
location
:
chain
.
location
,
location
:
chain
.
location
,
response
:
chain
.
response
,
response
:
chain
.
response
,
...
@@ -75,13 +73,13 @@ export default (selectChain: MsgSelectChain) => {
...
@@ -75,13 +73,13 @@ export default (selectChain: MsgSelectChain) => {
fetchSelectHintMeta
({
fetchSelectHintMeta
({
selectHintData
:
203
,
selectHintData
:
203
,
});
});
messageStore
.
checkCardModal
.
isOpen
=
true
;
messageStore
.
selectCardActions
.
isOpen
=
true
;
break
;
break
;
}
}
case
4
:
{
case
4
:
{
// 有一张强制发动的卡,直接回应
// 有一张强制发动的卡,直接回应
sendSelect
Chain
Response
(
chains
[
0
].
response
);
sendSelect
Single
Response
(
chains
[
0
].
response
);
break
;
break
;
}
}
...
...
src/service/duel/selectEffectYn.ts
View file @
6f35edc4
import
{
fetchStrings
,
ygopro
}
from
"
@/api
"
;
import
{
fetchStrings
,
ygopro
}
from
"
@/api
"
;
import
{
CardMeta
,
fetchCard
}
from
"
@/api/cards
"
;
import
{
CardMeta
,
fetchCard
}
from
"
@/api/cards
"
;
import
{
CardZoneToChinese
,
messageStore
}
from
"
@/stores
"
;
import
{
messageStore
}
from
"
@/stores
"
;
type
MsgSelectEffectYn
=
ygopro
.
StocGameMessage
.
MsgSelectEffectYn
;
type
MsgSelectEffectYn
=
ygopro
.
StocGameMessage
.
MsgSelectEffectYn
;
// 这里改成了 async 不知道有没有影响
// 这里改成了 async 不知道有没有影响
export
default
async
(
selectEffectYn
:
MsgSelectEffectYn
)
=>
{
export
default
async
(
selectEffectYn
:
MsgSelectEffectYn
)
=>
{
const
player
=
selectEffectYn
.
player
;
const
code
=
selectEffectYn
.
code
;
const
code
=
selectEffectYn
.
code
;
const
location
=
selectEffectYn
.
location
;
const
location
=
selectEffectYn
.
location
;
const
effect_description
=
selectEffectYn
.
effect_description
;
const
effect_description
=
selectEffectYn
.
effect_description
;
...
@@ -20,7 +19,7 @@ export default async (selectEffectYn: MsgSelectEffectYn) => {
...
@@ -20,7 +19,7 @@ export default async (selectEffectYn: MsgSelectEffectYn) => {
)
=>
{
)
=>
{
const
desc1
=
desc
.
replace
(
const
desc1
=
desc
.
replace
(
`[%ls]`
,
`[%ls]`
,
CardZoneToChinese
(
cardLocation
.
location
)
fetchStrings
(
"
!system
"
,
cardLocation
.
location
+
1000
)
);
);
const
desc2
=
desc1
.
replace
(
`[%ls]`
,
cardMeta
.
text
.
name
||
"
[?]
"
);
const
desc2
=
desc1
.
replace
(
`[%ls]`
,
cardMeta
.
text
.
name
||
"
[?]
"
);
return
desc2
;
return
desc2
;
...
@@ -29,14 +28,7 @@ export default async (selectEffectYn: MsgSelectEffectYn) => {
...
@@ -29,14 +28,7 @@ export default async (selectEffectYn: MsgSelectEffectYn) => {
const
desc1
=
desc
.
replace
(
`[%ls]`
,
cardMeta
.
text
.
name
||
"
[?]
"
);
const
desc1
=
desc
.
replace
(
`[%ls]`
,
cardMeta
.
text
.
name
||
"
[?]
"
);
return
desc1
;
return
desc1
;
};
};
// dispatch(
// fetchYesNoMeta({
// code,
// location,
// descCode: effect_description,
// textGenerator,
// })
// );
// TODO: 国际化文案
// TODO: 国际化文案
const
desc
=
fetchStrings
(
"
!system
"
,
effect_description
);
const
desc
=
fetchStrings
(
"
!system
"
,
effect_description
);
...
...
src/service/duel/selectSum.ts
View file @
6f35edc4
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
sV3
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
type
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
type
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
export
default
(
selectSum
:
MsgSelectSum
)
=>
{
export
default
(
selectSum
:
MsgSelectSum
)
=>
{
messageStore
.
checkCardModalV3
.
overflow
=
selectSum
.
overflow
!=
0
;
messageStore
.
selectCardActions
.
overflow
=
selectSum
.
overflow
!=
0
;
messageStore
.
checkCardModalV3
.
allLevel
=
selectSum
.
level_sum
;
messageStore
.
selectCardActions
.
totalLevels
=
selectSum
.
level_sum
;
messageStore
.
checkCardModalV3
.
selectM
in
=
selectSum
.
min
;
messageStore
.
selectCardActions
.
m
in
=
selectSum
.
min
;
messageStore
.
checkCardModalV3
.
selectM
ax
=
selectSum
.
max
;
messageStore
.
selectCardActions
.
m
ax
=
selectSum
.
max
;
fetchCheckCardMetasV3
({
for
(
const
option
of
selectSum
.
must_select_cards
)
{
mustSelect
:
true
,
fetchCheckCardMeta
(
option
,
false
,
true
);
options
:
selectSum
.
must_select_cards
,
}
});
fetchCheckCardMetasV3
({
for
(
const
option
of
selectSum
.
selectable_cards
)
{
mustSelect
:
false
,
fetchCheckCardMeta
(
option
);
options
:
selectSum
.
selectable_cards
,
}
});
messageStore
.
checkCardModalV3
.
isOpen
=
true
;
messageStore
.
selectCardActions
.
isOpen
=
true
;
};
};
src/service/duel/selectTribute.ts
View file @
6f35edc4
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
sV3
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
type
MsgSelectTribute
=
ygopro
.
StocGameMessage
.
MsgSelectTribute
;
type
MsgSelectTribute
=
ygopro
.
StocGameMessage
.
MsgSelectTribute
;
export
default
(
selectTribute
:
MsgSelectTribute
)
=>
{
export
default
(
selectTribute
:
MsgSelectTribute
)
=>
{
// TODO: 当玩家选择卡数大于`max`时,是否也合法?
// TODO: 当玩家选择卡数大于`max`时,是否也合法?
messageStore
.
checkCardModalV3
.
overflow
=
true
;
messageStore
.
selectCardActions
.
overflow
=
true
;
messageStore
.
checkCardModalV3
.
allLevel
=
0
;
messageStore
.
selectCardActions
.
totalLevels
=
0
;
messageStore
.
checkCardModalV3
.
selectM
in
=
selectTribute
.
min
;
messageStore
.
selectCardActions
.
m
in
=
selectTribute
.
min
;
messageStore
.
checkCardModalV3
.
selectM
ax
=
selectTribute
.
max
;
messageStore
.
selectCardActions
.
m
ax
=
selectTribute
.
max
;
fetchCheckCardMetasV3
({
for
(
const
option
of
selectTribute
.
selectable_cards
)
{
mustSelect
:
false
,
fetchCheckCardMeta
(
option
);
options
:
selectTribute
.
selectable_cards
.
map
((
card
)
=>
{
}
return
{
code
:
card
.
code
,
location
:
card
.
location
,
level1
:
card
.
level
,
level2
:
card
.
level
,
response
:
card
.
response
,
};
}),
});
messageStore
.
checkCardModalV3
.
isOpen
=
true
;
messageStore
.
selectCardActions
.
isOpen
=
true
;
};
};
src/service/duel/selectUnselectCard.ts
View file @
6f35edc4
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
fetchCheckCardMeta
sV2
,
messageStore
}
from
"
@/stores
"
;
import
{
fetchCheckCardMeta
,
messageStore
}
from
"
@/stores
"
;
type
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
type
MsgSelectUnselectCard
=
ygopro
.
StocGameMessage
.
MsgSelectUnselectCard
;
...
@@ -11,33 +11,18 @@ export default ({
...
@@ -11,33 +11,18 @@ export default ({
selectable_cards
:
selectableCards
,
selectable_cards
:
selectableCards
,
selected_cards
:
selectedCards
,
selected_cards
:
selectedCards
,
}:
MsgSelectUnselectCard
)
=>
{
}:
MsgSelectUnselectCard
)
=>
{
messageStore
.
checkCardModalV2
.
isOpen
=
true
;
messageStore
.
selectCardActions
.
isOpen
=
true
;
messageStore
.
checkCardModalV2
.
finishAble
=
finishable
;
messageStore
.
selectCardActions
.
finishAble
=
finishable
;
messageStore
.
checkCardModalV2
.
cancelAble
=
cancelable
;
messageStore
.
selectCardActions
.
cancelAble
=
cancelable
;
messageStore
.
checkCardModalV2
.
selectMin
=
min
;
messageStore
.
selectCardActions
.
min
=
min
;
messageStore
.
checkCardModalV2
.
selectMax
=
max
;
messageStore
.
selectCardActions
.
max
=
max
;
messageStore
.
selectCardActions
.
single
=
true
;
fetchCheckCardMetasV2
({
for
(
const
option
of
selectableCards
)
{
selected
:
false
,
fetchCheckCardMeta
(
option
);
options
:
selectableCards
.
map
((
card
)
=>
{
}
return
{
code
:
card
.
code
,
location
:
card
.
location
,
response
:
card
.
response
,
};
}),
});
fetchCheckCardMetasV2
({
for
(
const
option
of
selectedCards
)
{
selected
:
true
,
fetchCheckCardMeta
(
option
,
true
);
options
:
selectedCards
.
map
((
card
)
=>
{
}
return
{
code
:
card
.
code
,
location
:
card
.
location
,
response
:
card
.
response
,
};
}),
});
messageStore
.
checkCardModalV2
.
responseable
=
true
;
};
};
src/stores/matStore/methods/cardZoneToChinese.ts
deleted
100644 → 0
View file @
3803129a
import
{
ygopro
}
from
"
@/api
"
;
export
function
CardZoneToChinese
(
zone
:
ygopro
.
CardZone
):
string
{
switch
(
zone
)
{
case
ygopro
.
CardZone
.
DECK
:
{
return
"
卡组
"
;
}
case
ygopro
.
CardZone
.
HAND
:
{
return
"
手牌
"
;
}
case
ygopro
.
CardZone
.
EXTRA
:
{
return
"
额外卡组
"
;
}
case
ygopro
.
CardZone
.
GRAVE
:
{
return
"
墓地
"
;
}
case
ygopro
.
CardZone
.
FZONE
:
{
return
"
FZONE
"
;
}
case
ygopro
.
CardZone
.
MZONE
:
{
return
"
怪兽区
"
;
}
case
ygopro
.
CardZone
.
SZONE
:
{
return
"
魔法陷阱区
"
;
}
case
ygopro
.
CardZone
.
REMOVED
:
{
return
"
除外区
"
;
}
case
ygopro
.
CardZone
.
OVERLAY
:
{
return
"
超量区
"
;
}
case
ygopro
.
CardZone
.
PZONE
:
{
return
"
灵摆区
"
;
}
case
ygopro
.
CardZone
.
ONFIELD
:
{
return
"
场地区
"
;
}
default
:
{
return
"
未知区域
"
;
}
}
}
src/stores/matStore/methods/fetchCheckCardMeta.ts
View file @
6f35edc4
...
@@ -2,102 +2,50 @@ import { ygopro } from "@/api";
...
@@ -2,102 +2,50 @@ import { ygopro } from "@/api";
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
CardZoneToChinese
}
from
"
./cardZoneToChinese
"
;
type
Location
=
|
ygopro
.
CardLocation
|
ReturnType
<
typeof
ygopro
.
CardLocation
.
prototype
.
toObject
>
;
function
cmpCardLocation
(
left
:
Location
,
right
?:
Location
,
strict
?:
boolean
):
boolean
{
if
(
strict
)
{
return
JSON
.
stringify
(
left
)
===
JSON
.
stringify
(
right
);
}
else
{
return
(
left
.
controler
===
right
?.
controler
&&
left
.
location
===
right
?.
location
&&
left
.
sequence
===
right
?.
sequence
);
}
}
/**
* 这段代码定义了一个异步函数 fetchCheckCardMeta,它的作用是获取一张卡片的元数据并将其添加到某个名为 messageStore.checkCardModal 的对象上。
该函数的第一个参数是一个枚举值 ygopro.CardZone,表示卡片所在的区域。其余参数是一个包含卡片编号、位置、响应码和效果描述代码等信息的对象。
首先,这个函数会根据区域类型调用 CardZoneToChinese() 函数生成一个中文名称。然后,它会调用 fetchCard() 异步函数来获取指定卡片的元数据 meta。
接下来,函数会根据传递进来的 location 对象获取卡片所属的控制者,并根据控制者判断这张卡片是我方的还是对方的。然后,它会根据卡片的位置信息获取卡片的实际 ID,并构造一个新的选项 newOption。
接着,函数会遍历已有的 messageStore.checkCardModal.tags,查找是否存在名为 combinedTagName 的标签。如果找到了,则将新选项 newOption 加入该标签的选项列表中并立即返回。如果找不到,则创建一个新标签,并将新选项 newOption 添加到其中。
最后,函数会再次遍历所有标签,查找是否存在名为 combinedTagName 的标签。如果找到了,则遍历该标签中的所有选项,并查找是否存在与 location 对象中指定的卡片位置信息完全相同的选项。如果找到了,则更新该选项的元数据和效果描述等信息。
*/
export
const
fetchCheckCardMeta
=
async
(
export
const
fetchCheckCardMeta
=
async
(
zone
:
ygopro
.
CardZone
,
{
{
code
,
code
,
location
,
location
,
level1
,
level2
,
response
,
response
,
effectDescCode
,
effectDescCode
,
}:
{
}:
{
code
:
number
;
code
:
number
;
location
:
ygopro
.
CardLocation
;
location
:
ygopro
.
CardLocation
;
level1
?:
number
;
level2
?:
number
;
response
:
number
;
response
:
number
;
effectDescCode
?:
number
;
effectDescCode
?:
number
;
}
},
selected
?:
boolean
,
mustSelect
?:
boolean
)
=>
{
)
=>
{
const
tagName
=
CardZoneToChinese
(
zone
);
const
meta
=
await
fetchCard
(
code
);
const
controller
=
location
.
controler
;
const
controller
=
location
.
controler
;
const
combinedTagName
=
matStore
.
isMe
(
controller
)
?
`我方的
${
tagName
}
`
:
`对方的
${
tagName
}
`
;
const
newID
=
const
newID
=
code
!=
0
code
!=
0
?
code
?
code
:
matStore
.
in
(
location
.
location
).
of
(
controller
)[
location
.
sequence
]
:
matStore
.
in
(
location
.
location
).
of
(
controller
)[
location
.
sequence
]
?.
occupant
?.
id
||
0
;
?.
occupant
?.
id
||
0
;
const
meta
=
await
fetchCard
(
code
);
const
effectDesc
=
effectDescCode
?
getCardStr
(
meta
,
effectDescCode
&
0xf
)
:
undefined
;
const
newOption
=
{
const
newOption
=
{
meta
:
{
id
:
newID
,
data
:
{},
text
:
{}
}
,
code
:
newID
,
location
:
location
.
toObject
(),
location
:
location
.
toObject
(),
effectDescCode
,
level1
,
level2
,
effectDesc
,
response
,
response
,
};
};
for
(
const
tag
of
messageStore
.
checkCardModal
.
tags
)
{
if
(
tag
.
tagName
===
combinedTagName
)
{
tag
.
options
.
push
(
newOption
);
return
;
}
}
messageStore
.
checkCardModal
.
tags
.
push
({
tagName
:
combinedTagName
,
options
:
[
newOption
],
});
for
(
const
tag
of
messageStore
.
checkCardModal
.
tags
)
{
if
(
selected
)
{
if
(
tag
.
tagName
===
combinedTagName
)
{
messageStore
.
selectCardActions
.
selecteds
.
push
(
newOption
);
for
(
const
old
of
tag
.
options
)
{
}
else
if
(
mustSelect
)
{
if
(
meta
.
id
==
old
.
meta
.
id
&&
cmpCardLocation
(
location
,
old
.
location
))
{
messageStore
.
selectCardActions
.
mustSelects
.
push
(
newOption
);
const
cardID
=
old
.
meta
.
id
;
}
else
{
old
.
meta
=
meta
;
messageStore
.
selectCardActions
.
selectables
.
push
(
newOption
);
old
.
meta
.
id
=
cardID
;
const
effectDescCode
=
old
.
effectDescCode
;
const
effectDesc
=
effectDescCode
?
getCardStr
(
old
.
meta
,
effectDescCode
&
0xf
)
:
undefined
;
old
.
effectDesc
=
effectDesc
;
}
}
}
}
}
};
};
src/stores/matStore/methods/index.ts
View file @
6f35edc4
export
*
from
"
./cardZoneToChinese
"
;
export
*
from
"
./fetchCheckCardMeta
"
;
export
*
from
"
./fetchCheckCardMeta
"
;
export
*
from
"
./fetchHint
"
;
export
*
from
"
./fetchHint
"
;
export
*
from
"
./fetchOverlayMeta
"
;
export
*
from
"
./fetchOverlayMeta
"
;
...
...
src/stores/messageStore/methods/clearSelectActions.ts
0 → 100644
View file @
6f35edc4
import
{
messageStore
}
from
"
../store
"
;
const
{
selectCardActions
}
=
messageStore
;
export
const
clearSelectActions
=
()
=>
{
selectCardActions
.
isOpen
=
false
;
selectCardActions
.
isChain
=
undefined
;
selectCardActions
.
min
=
undefined
;
selectCardActions
.
max
=
undefined
;
selectCardActions
.
cancelAble
=
false
;
selectCardActions
.
totalLevels
=
undefined
;
selectCardActions
.
selecteds
=
[];
selectCardActions
.
selectables
=
[];
selectCardActions
.
mustSelects
=
[];
selectCardActions
.
finishAble
=
false
;
selectCardActions
.
overflow
=
false
;
selectCardActions
.
single
=
undefined
;
};
src/stores/messageStore/methods/fetchCheckCardMetasV2.ts
deleted
100644 → 0
View file @
3803129a
import
{
fetchCard
,
type
ygopro
}
from
"
@/api
"
;
import
{
getCardByLocation
,
messageStore
}
from
"
@/stores
"
;
export
const
fetchCheckCardMetasV2
=
async
({
selected
,
options
,
}:
{
selected
:
boolean
;
options
:
{
code
:
number
;
location
:
ygopro
.
CardLocation
;
response
:
number
;
name
?:
string
;
desc
?:
string
;
}[];
})
=>
{
const
metas
=
await
Promise
.
all
(
options
.
map
(
async
(
option
)
=>
{
return
await
fetchCard
(
option
.
code
,
true
);
})
);
for
(
const
option
of
options
)
{
if
(
option
.
code
==
0
)
{
const
newCode
=
getCardByLocation
(
option
.
location
)?.
occupant
?.
id
||
0
;
option
.
code
=
newCode
;
}
}
options
.
forEach
((
option
)
=>
{
metas
.
forEach
((
meta
)
=>
{
if
(
option
.
code
==
meta
.
id
)
{
option
.
name
=
meta
.
text
.
name
;
option
.
desc
=
meta
.
text
.
desc
;
}
});
});
if
(
selected
)
{
messageStore
.
checkCardModalV2
.
selectedOptions
=
options
;
}
else
{
messageStore
.
checkCardModalV2
.
selectableOptions
=
options
;
}
};
src/stores/messageStore/methods/fetchCheckCardMetasV3.ts
deleted
100644 → 0
View file @
3803129a
import
{
fetchCard
,
type
ygopro
}
from
"
@/api
"
;
import
{
getCardByLocation
,
messageStore
}
from
"
@/stores
"
;
export
const
fetchCheckCardMetasV3
=
async
({
mustSelect
,
options
,
}:
{
mustSelect
:
boolean
;
options
:
{
code
:
number
;
location
:
ygopro
.
CardLocation
;
level1
:
number
;
level2
:
number
;
response
:
number
;
}[];
})
=>
{
const
metas
=
await
Promise
.
all
(
options
.
map
(
async
(
option
)
=>
{
return
await
fetchCard
(
option
.
code
,
true
);
})
);
const
newOptions
=
options
.
map
((
option
)
=>
{
if
(
option
.
code
==
0
)
{
const
newCode
=
getCardByLocation
(
option
.
location
)?.
occupant
?.
id
||
0
;
option
.
code
=
newCode
;
}
return
{
meta
:
{
id
:
option
.
code
,
data
:
{},
text
:
{}
},
level1
:
option
.
level1
,
level2
:
option
.
level2
,
response
:
option
.
response
,
};
});
newOptions
.
forEach
((
option
)
=>
{
metas
.
forEach
((
meta
)
=>
{
if
(
option
.
meta
.
id
==
meta
.
id
)
{
option
.
meta
=
meta
;
}
});
});
if
(
mustSelect
)
{
messageStore
.
checkCardModalV3
.
mustSelectList
=
newOptions
;
}
else
{
messageStore
.
checkCardModalV3
.
selectAbleList
=
newOptions
;
}
};
src/stores/messageStore/methods/index.ts
View file @
6f35edc4
export
*
from
"
./clearAllIdleInteractivities
"
;
export
*
from
"
./clearAllIdleInteractivities
"
;
export
*
from
"
./clearAllPlaceInteradtivities
"
;
export
*
from
"
./clearAllPlaceInteradtivities
"
;
export
*
from
"
./fetchCheckCardMetasV2
"
;
export
*
from
"
./clearSelectActions
"
;
export
*
from
"
./fetchCheckCardMetasV3
"
;
src/stores/messageStore/store.ts
View file @
6f35edc4
...
@@ -5,25 +5,17 @@ import type { ModalState } from "./types";
...
@@ -5,25 +5,17 @@ import type { ModalState } from "./types";
export
const
messageStore
=
proxy
<
ModalState
>
({
export
const
messageStore
=
proxy
<
ModalState
>
({
cardModal
:
{
isOpen
:
false
,
interactivies
:
[],
counters
:
{}
},
cardModal
:
{
isOpen
:
false
,
interactivies
:
[],
counters
:
{}
},
cardListModal
:
{
isOpen
:
false
,
list
:
[]
},
cardListModal
:
{
isOpen
:
false
,
list
:
[]
},
checkCardModal
:
{
isOpen
:
false
,
cancelAble
:
false
,
tags
:
[]
},
selectCardActions
:
{
yesNoModal
:
{
isOpen
:
false
},
positionModal
:
{
isOpen
:
false
,
positions
:
[]
},
optionModal
:
{
isOpen
:
false
,
options
:
[]
},
checkCardModalV2
:
{
isOpen
:
false
,
isOpen
:
false
,
cancelAble
:
false
,
cancelAble
:
false
,
finishAble
:
false
,
finishAble
:
false
,
responseable
:
false
,
selecteds
:
[],
selectableOptions
:
[],
selectables
:
[],
selectedOptions
:
[],
mustSelects
:
[],
},
checkCardModalV3
:
{
isOpen
:
false
,
overflow
:
false
,
allLevel
:
0
,
mustSelectList
:
[],
selectAbleList
:
[],
},
},
yesNoModal
:
{
isOpen
:
false
},
positionModal
:
{
isOpen
:
false
,
positions
:
[]
},
optionModal
:
{
isOpen
:
false
,
options
:
[]
},
checkCounterModal
:
{
checkCounterModal
:
{
isOpen
:
false
,
isOpen
:
false
,
options
:
[],
options
:
[],
...
...
src/stores/messageStore/types.ts
View file @
6f35edc4
import
type
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
import
type
{
CardMeta
,
ygopro
}
from
"
@/api
"
;
type
CardLocation
=
ReturnType
<
typeof
ygopro
.
CardLocation
.
prototype
.
toObject
>
;
type
CardLocation
=
ReturnType
<
typeof
ygopro
.
CardLocation
.
prototype
.
toObject
>
;
interface
Option
{
// card id
code
:
number
;
location
?:
CardLocation
;
// 效果
effectDesc
?:
string
;
// 作为素材的cost,比如同调召唤的星级
level1
?:
number
;
level2
?:
number
;
response
:
number
;
}
export
interface
ModalState
{
export
interface
ModalState
{
// 卡牌弹窗
// 卡牌弹窗
cardModal
:
{
cardModal
:
{
...
@@ -17,24 +29,27 @@ export interface ModalState {
...
@@ -17,24 +29,27 @@ export interface ModalState {
interactivies
:
{
desc
:
string
;
response
:
number
}[];
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[];
}[];
};
};
// 卡牌选择
弹窗
// 卡牌选择
状态
checkCardModal
:
{
selectCardActions
:
{
isOpen
:
boolean
;
isOpen
:
boolean
;
onSubmit
?:
string
;
// 如果是连锁,发response给后端的方式稍微有点不同,这里标记下
selectMin
?:
number
;
isChain
?:
boolean
;
selectMax
?:
number
;
min
?:
number
;
max
?:
number
;
// 是否只能选择单个
single
?:
boolean
;
cancelAble
:
boolean
;
cancelAble
:
boolean
;
cancelResponse
?:
number
;
finishAble
:
boolean
;
tags
:
{
// 上级/同调/超量/链接召唤的总cost
tagName
:
string
;
totalLevels
?:
number
;
options
:
{
// cost是否可以溢出,比如同调召唤是false,某些链接召唤是true
meta
:
CardMeta
;
overflow
?:
boolean
;
location
?:
CardLocation
;
// 已经选择的列表
effectDescCode
?:
number
;
selecteds
:
Option
[]
;
effectDesc
?:
string
;
// 可以选择的列表
response
:
number
;
selectables
:
Option
[]
;
}[];
// 必须选择的列表
}
[];
mustSelects
:
Option
[];
};
};
// Yes or No弹窗
// Yes or No弹窗
yesNoModal
:
{
yesNoModal
:
{
...
@@ -51,48 +66,6 @@ export interface ModalState {
...
@@ -51,48 +66,6 @@ export interface ModalState {
isOpen
:
boolean
;
isOpen
:
boolean
;
options
:
{
msg
:
string
;
response
:
number
}[];
options
:
{
msg
:
string
;
response
:
number
}[];
};
};
// 卡牌选择弹窗V2
checkCardModalV2
:
{
isOpen
:
boolean
;
cancelAble
:
boolean
;
finishAble
:
boolean
;
selectMin
?:
number
;
selectMax
?:
number
;
responseable
?:
boolean
;
selectableOptions
:
{
code
:
number
;
name
?:
string
;
desc
?:
string
;
response
:
number
;
}[];
selectedOptions
:
{
code
:
number
;
name
?:
string
;
desc
?:
string
;
response
:
number
;
}[];
};
// 卡牌选择弹窗V3
checkCardModalV3
:
{
isOpen
:
boolean
;
overflow
:
boolean
;
allLevel
:
number
;
selectMin
?:
number
;
selectMax
?:
number
;
responseable
?:
boolean
;
mustSelectList
:
{
meta
:
CardMeta
;
level1
:
number
;
level2
:
number
;
response
:
number
;
}[];
selectAbleList
:
{
meta
:
CardMeta
;
level1
:
number
;
level2
:
number
;
response
:
number
;
}[];
};
// 指示器选择弹窗
// 指示器选择弹窗
checkCounterModal
:
{
checkCounterModal
:
{
isOpen
:
boolean
;
isOpen
:
boolean
;
...
...
src/ui/Duel/Main.tsx
View file @
6f35edc4
...
@@ -4,13 +4,11 @@ import {
...
@@ -4,13 +4,11 @@ import {
Alert
,
Alert
,
CardListModal
,
CardListModal
,
CardModal
,
CardModal
,
CheckCardModal
,
CheckCardModalV2
,
CheckCardModalV3
,
CheckCounterModal
,
CheckCounterModal
,
HintNotification
,
HintNotification
,
OptionModal
,
OptionModal
,
PositionModal
,
PositionModal
,
SelectActionsModal
,
SortCardModal
,
SortCardModal
,
YesNoModal
,
YesNoModal
,
}
from
"
./Message
"
;
}
from
"
./Message
"
;
...
@@ -24,12 +22,10 @@ const NeosDuel = () => {
...
@@ -24,12 +22,10 @@ const NeosDuel = () => {
<
CardModal
/>
<
CardModal
/>
<
CardListModal
/>
<
CardListModal
/>
<
HintNotification
/>
<
HintNotification
/>
<
CheckCard
Modal
/>
<
SelectActions
Modal
/>
<
YesNoModal
/>
<
YesNoModal
/>
<
PositionModal
/>
<
PositionModal
/>
<
OptionModal
/>
<
OptionModal
/>
<
CheckCardModalV2
/>
<
CheckCardModalV3
/>
<
CheckCounterModal
/>
<
CheckCounterModal
/>
<
SortCardModal
/>
<
SortCardModal
/>
</>
</>
...
...
src/ui/Duel/Message/CheckCardModal.tsx
deleted
100644 → 0
View file @
3803129a
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Col
,
Popover
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
NeosConfig
=
useConfig
();
const
{
checkCardModal
}
=
messageStore
;
export
const
CheckCardModal
=
()
=>
{
const
snapCheckCardModal
=
useSnapshot
(
checkCardModal
);
const
isOpen
=
snapCheckCardModal
.
isOpen
;
const
min
=
snapCheckCardModal
.
selectMin
??
0
;
const
max
=
snapCheckCardModal
.
selectMax
??
10
;
const
tabs
=
snapCheckCardModal
.
tags
;
const
onSubmit
=
snapCheckCardModal
.
onSubmit
;
const
cancelAble
=
snapCheckCardModal
.
cancelAble
;
const
cancelResponse
=
snapCheckCardModal
.
cancelResponse
;
const
[
response
,
setResponse
]
=
useState
<
number
[]
>
([]);
const
defaultValue
:
number
[]
=
[];
const
hint
=
useSnapshot
(
matStore
.
hint
);
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
// TODO: 这里可以考虑更好地封装
const
sendResponseHandler
=
(
handlerName
:
string
|
undefined
,
response
:
number
[]
)
=>
{
switch
(
handlerName
)
{
case
"
sendSelectChainResponse
"
:
{
sendSelectChainResponse
(
response
[
0
]);
break
;
}
case
"
sendSelectCardResponse
"
:
{
sendSelectCardResponse
(
response
);
break
;
}
default
:
{
}
}
};
const
resetCheckCardModal
=
()
=>
{
checkCardModal
.
isOpen
=
false
;
checkCardModal
.
selectMin
=
undefined
;
checkCardModal
.
selectMax
=
undefined
;
checkCardModal
.
cancelAble
=
false
;
checkCardModal
.
cancelResponse
=
undefined
;
checkCardModal
.
tags
=
[];
};
return
(
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max}`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<>
<
Button
disabled=
{
response
.
length
<
min
||
response
.
length
>
max
}
onClick=
{
()
=>
{
sendResponseHandler
(
onSubmit
,
response
);
checkCardModal
.
isOpen
=
false
;
resetCheckCardModal
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
submit
</
Button
>
{
cancelAble
?
(
<
Button
onClick=
{
()
=>
{
if
(
cancelResponse
)
{
sendResponseHandler
(
onSubmit
,
[
cancelResponse
]);
}
checkCardModal
.
isOpen
=
false
;
resetCheckCardModal
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
cancel
</
Button
>
)
:
(
<></>
)
}
</>
}
width=
{
800
}
>
<
CheckCard
.
Group
multiple
bordered
size=
"small"
defaultValue=
{
defaultValue
}
onChange=
{
(
value
)
=>
{
// @ts-ignore
setResponse
(
value
);
}
}
>
{
tabs
.
map
((
tab
,
idx
)
=>
{
return
(
<
Row
key=
{
idx
}
>
{
tab
.
options
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
HoverCheckCard
hoverContent=
{
option
.
effectDesc
}
title=
{
option
.
meta
.
text
.
name
}
description=
{
option
.
meta
.
text
.
desc
}
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
option
.
meta
.
id
?
`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
style=
{
{
width
:
100
}
}
/>
}
value=
{
option
.
response
}
/>
</
Col
>
);
})
}
</
Row
>
);
})
}
</
CheckCard
.
Group
>
</
DragModal
>
);
};
const
HoverCheckCard
=
(
props
:
CheckCardProps
&
{
hoverContent
?:
string
})
=>
{
const
[
hover
,
setHover
]
=
useState
(
false
);
const
onMouseEnter
=
()
=>
setHover
(
true
);
const
onMouseLeave
=
()
=>
setHover
(
false
);
return
(
<>
<
CheckCard
{
...
props
}
/>
{
props
.
hoverContent
?
(
<
Popover
content=
{
<
p
>
{
props
.
hoverContent
}
</
p
>
}
open=
{
hover
}
>
<
Button
icon=
{
<
ThunderboltOutlined
/>
}
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
></
Button
>
</
Popover
>
)
:
(
<></>
)
}
</>
);
};
src/ui/Duel/Message/CheckCardModalV2.tsx
deleted
100644 → 0
View file @
3803129a
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
sendSelectUnselectCardResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
{
checkCardModalV2
}
=
messageStore
;
const
NeosConfig
=
useConfig
();
export
const
CheckCardModalV2
=
()
=>
{
const
snapCheckCardModalV2
=
useSnapshot
(
checkCardModalV2
);
const
isOpen
=
snapCheckCardModalV2
.
isOpen
;
const
min
=
snapCheckCardModalV2
.
selectMin
??
0
;
const
max
=
snapCheckCardModalV2
.
selectMax
??
10
;
const
cancelable
=
snapCheckCardModalV2
.
cancelAble
;
const
finishable
=
snapCheckCardModalV2
.
finishAble
;
const
selectableOptions
=
snapCheckCardModalV2
.
selectableOptions
;
const
selectedOptions
=
snapCheckCardModalV2
.
selectedOptions
;
const
responseable
=
snapCheckCardModalV2
.
responseable
;
const
hint
=
useSnapshot
(
matStore
.
hint
);
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
const
resetCheckCardModalV2
=
()
=>
{
checkCardModalV2
.
isOpen
=
false
;
checkCardModalV2
.
finishAble
=
false
;
checkCardModalV2
.
cancelAble
=
false
;
checkCardModalV2
.
responseable
=
false
;
checkCardModalV2
.
selectableOptions
=
[];
checkCardModalV2
.
selectedOptions
=
[];
};
const
onFinishOrCancel
=
()
=>
{
sendSelectUnselectCardResponse
({
cancel_or_finish
:
true
});
checkCardModalV2
.
isOpen
=
false
;
checkCardModalV2
.
responseable
=
false
;
resetCheckCardModalV2
();
};
return
(
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max}`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<>
<
Button
disabled=
{
!
finishable
||
!
responseable
}
onClick=
{
onFinishOrCancel
}
>
finish
</
Button
>
<
Button
disabled=
{
!
cancelable
||
!
responseable
}
onClick=
{
onFinishOrCancel
}
>
cancel
</
Button
>
</>
}
width=
{
800
}
>
<
CheckCard
.
Group
bordered
size=
"small"
onChange=
{
(
value
)
=>
{
if
(
responseable
)
{
// @ts-ignore
sendSelectUnselectCardResponse
({
selected_ptr
:
value
});
checkCardModalV2
.
isOpen
=
false
;
checkCardModalV2
.
responseable
=
false
;
}
}
}
>
<
Row
>
{
selectableOptions
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
CheckCard
title=
{
option
.
name
}
description=
{
option
.
desc
}
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
code
.
toString
()
}
src=
{
`${NeosConfig.cardImgUrl}/${option.code}.jpg`
}
style=
{
{
width
:
100
}
}
/>
}
value=
{
option
.
response
}
/>
</
Col
>
);
})
}
</
Row
>
</
CheckCard
.
Group
>
<
p
>
已经选择的卡片
</
p
>
<
Row
>
{
selectedOptions
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
Card
hoverable
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
code
.
toString
()
}
src=
{
`${NeosConfig.cardImgUrl}/${option.code}.jpg`
}
/>
}
/>
</
Col
>
);
})
}
</
Row
>
</
DragModal
>
);
};
src/ui/Duel/Message/CheckCardModalV3.tsx
deleted
100644 → 0
View file @
3803129a
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
sendSelectCardResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
NeosConfig
=
useConfig
();
const
{
checkCardModalV3
}
=
messageStore
;
export
const
CheckCardModalV3
=
()
=>
{
const
snapCheckCardModalV3
=
useSnapshot
(
checkCardModalV3
);
const
isOpen
=
snapCheckCardModalV3
.
isOpen
;
const
min
=
snapCheckCardModalV3
.
selectMin
||
0
;
const
max
=
snapCheckCardModalV3
.
selectMax
||
0
;
const
mustSelectOptions
=
snapCheckCardModalV3
.
mustSelectList
;
const
selectAbleOptions
=
snapCheckCardModalV3
.
selectAbleList
;
const
overflow
=
snapCheckCardModalV3
.
overflow
;
const
LevelSum
=
snapCheckCardModalV3
.
allLevel
;
const
[
selectedOptions
,
setSelectedOptions
]
=
useState
([]);
const
Level1Sum
=
mustSelectOptions
.
concat
(
selectedOptions
)
.
map
((
option
)
=>
option
.
level1
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
Level2Sum
=
mustSelectOptions
.
concat
(
selectedOptions
)
.
map
((
option
)
=>
option
.
level2
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
hint
=
useSnapshot
(
matStore
.
hint
);
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
const
responseable
=
(
overflow
?
Level1Sum
>=
LevelSum
||
Level2Sum
>=
LevelSum
:
Level1Sum
==
LevelSum
||
Level2Sum
==
LevelSum
)
&&
selectedOptions
.
length
<=
max
&&
selectedOptions
.
length
>=
min
;
const
onFinish
=
()
=>
{
sendSelectCardResponse
(
mustSelectOptions
.
concat
(
selectedOptions
).
map
((
option
)
=>
option
.
response
)
);
checkCardModalV3
.
isOpen
=
false
;
checkCardModalV3
.
responseable
=
false
;
checkCardModalV3
.
overflow
=
false
;
checkCardModalV3
.
allLevel
=
0
;
checkCardModalV3
.
mustSelectList
=
[];
checkCardModalV3
.
selectAbleList
=
[];
};
return
(
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max}`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<>
<
Button
disabled=
{
!
responseable
}
onClick=
{
onFinish
}
>
finish
</
Button
>
</>
}
width=
{
800
}
>
<
CheckCard
.
Group
bordered
size=
"small"
multiple=
{
true
}
onChange=
{
(
values
:
any
)
=>
{
console
.
log
(
values
);
setSelectedOptions
(
values
);
}
}
>
<
Row
>
{
selectAbleOptions
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
CheckCard
title=
{
option
.
meta
.
text
.
name
}
description=
{
option
.
meta
.
text
.
desc
}
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
}
style=
{
{
width
:
100
}
}
/>
}
value=
{
option
}
/>
</
Col
>
);
})
}
</
Row
>
</
CheckCard
.
Group
>
<
p
>
必须选择的卡片
</
p
>
<
Row
>
{
mustSelectOptions
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
Card
hoverable
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
meta
.
id
.
toString
()
}
src=
{
`${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
}
/>
}
/>
</
Col
>
);
})
}
</
Row
>
</
DragModal
>
);
};
src/ui/Duel/Message/SelectActionsModal.tsx
0 → 100644
View file @
6f35edc4
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Popover
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
sendSelectMultiResponse
,
sendSelectSingleResponse
,
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearSelectActions
,
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
const
NeosConfig
=
useConfig
();
const
CANCEL_RESPONSE
=
-
1
;
const
FINISH_RESPONSE
=
-
1
;
const
{
selectCardActions
}
=
messageStore
;
export
const
SelectActionsModal
=
()
=>
{
const
snap
=
useSnapshot
(
selectCardActions
);
const
isOpen
=
snap
.
isOpen
;
const
isChain
=
snap
.
isChain
;
const
min
=
snap
.
min
??
0
;
const
max
=
snap
.
max
??
0
;
const
single
=
snap
.
single
??
false
;
const
selecteds
=
snap
.
selecteds
;
const
selectables
=
snap
.
selectables
;
const
mustSelects
=
snap
.
mustSelects
;
const
[
response
,
setResponse
]
=
useState
([]);
const
hint
=
useSnapshot
(
matStore
.
hint
);
const
preHintMsg
=
hint
?.
esHint
||
""
;
const
selectHintMsg
=
hint
?.
esSelectHint
||
"
请选择卡片
"
;
const
cancelable
=
snap
.
cancelAble
;
const
finishable
=
snap
.
finishAble
;
const
totalLevels
=
snap
.
totalLevels
??
0
;
const
overflow
=
snap
.
overflow
||
false
;
const
LevelSum1
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
level1
||
0
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
LevelSum2
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
level2
||
0
)
.
reduce
((
sum
,
current
)
=>
sum
+
current
,
0
);
const
levelMatched
=
overflow
?
LevelSum1
>=
totalLevels
||
LevelSum2
>=
totalLevels
:
LevelSum1
==
totalLevels
||
LevelSum2
==
totalLevels
;
const
submitable
=
single
?
response
.
length
==
1
:
response
.
length
>=
min
&&
response
.
length
<=
max
&&
levelMatched
;
return
(
<
DragModal
title=
{
`${preHintMsg} ${selectHintMsg} ${min}-${max} ${
single ? "每次选择一张" : ""
}`
}
open=
{
isOpen
}
closable=
{
false
}
footer=
{
<>
<
Button
disabled=
{
!
submitable
}
onClick=
{
()
=>
{
const
values
=
mustSelects
.
concat
(
response
)
.
map
((
option
)
=>
option
.
response
);
if
(
isChain
)
{
sendSelectSingleResponse
(
values
[
0
]);
}
else
{
sendSelectMultiResponse
(
values
);
}
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1211
)
}
</
Button
>
<
Button
disabled=
{
!
finishable
}
onClick=
{
()
=>
{
sendSelectSingleResponse
(
FINISH_RESPONSE
);
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1296
)
}
</
Button
>
<
Button
disabled=
{
!
cancelable
}
onClick=
{
()
=>
{
sendSelectSingleResponse
(
CANCEL_RESPONSE
);
clearSelectActions
();
}
}
onFocus=
{
()
=>
{}
}
onBlur=
{
()
=>
{}
}
>
{
fetchStrings
(
"
!system
"
,
1295
)
}
</
Button
>
</>
}
width=
{
800
}
>
<
CheckCard
.
Group
multiple
bordered
size=
"small"
onChange=
{
(
value
)
=>
{
// @ts-ignore
setResponse
(
value
);
}
}
>
<
Row
>
{
selectables
.
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
HoverCheckCard
hoverContent=
{
option
.
effectDesc
}
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
code
.
toString
()
}
src=
{
option
.
code
?
`${NeosConfig.cardImgUrl}/${option.code}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
style=
{
{
width
:
100
}
}
/>
}
value=
{
option
}
/>
</
Col
>
);
})
}
</
Row
>
<
p
>
{
fetchStrings
(
"
!system
"
,
212
)
}
</
p
>
<
Row
>
{
selecteds
.
concat
(
mustSelects
).
map
((
option
,
idx
)
=>
{
return
(
<
Col
span=
{
4
}
key=
{
idx
}
>
<
Card
style=
{
{
width
:
120
}
}
cover=
{
<
img
alt=
{
option
.
code
.
toString
()
}
src=
{
option
.
code
?
`${NeosConfig.cardImgUrl}/${option.code}.jpg`
:
`${NeosConfig.assetsPath}/card_back.jpg`
}
/>
}
/>
</
Col
>
);
})
}
</
Row
>
</
CheckCard
.
Group
>
</
DragModal
>
);
};
const
HoverCheckCard
=
(
props
:
CheckCardProps
&
{
hoverContent
?:
string
})
=>
{
const
[
hover
,
setHover
]
=
useState
(
false
);
const
onMouseEnter
=
()
=>
setHover
(
true
);
const
onMouseLeave
=
()
=>
setHover
(
false
);
return
(
<>
<
CheckCard
{
...
props
}
/>
{
props
.
hoverContent
?
(
<
Popover
content=
{
<
p
>
{
props
.
hoverContent
}
</
p
>
}
open=
{
hover
}
>
<
Button
icon=
{
<
ThunderboltOutlined
/>
}
onMouseEnter=
{
onMouseEnter
}
onMouseLeave=
{
onMouseLeave
}
></
Button
>
</
Popover
>
)
:
(
<></>
)
}
</>
);
};
src/ui/Duel/Message/index.ts
View file @
6f35edc4
export
*
from
"
./Alert
"
;
export
*
from
"
./Alert
"
;
export
*
from
"
./CardListModal
"
;
export
*
from
"
./CardListModal
"
;
export
*
from
"
./CardModal
"
;
export
*
from
"
./CardModal
"
;
export
*
from
"
./CheckCardModal
"
;
export
*
from
"
./CheckCardModalV2
"
;
export
*
from
"
./CheckCardModalV3
"
;
export
*
from
"
./CheckCounterModal
"
;
export
*
from
"
./CheckCounterModal
"
;
export
*
from
"
./DragModal
"
;
export
*
from
"
./DragModal
"
;
export
*
from
"
./HintNotification
"
;
export
*
from
"
./HintNotification
"
;
export
*
from
"
./OptionModal
"
;
export
*
from
"
./OptionModal
"
;
export
*
from
"
./PositionModal
"
;
export
*
from
"
./PositionModal
"
;
export
*
from
"
./SelectActionsModal
"
;
export
*
from
"
./SendBox
"
;
export
*
from
"
./SendBox
"
;
export
*
from
"
./SortCardModal
"
;
export
*
from
"
./SortCardModal
"
;
export
*
from
"
./Status
"
;
export
*
from
"
./Status
"
;
...
...
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