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
deft
Neos
Commits
a2e3a130
Commit
a2e3a130
authored
May 09, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/card_modal/effect' into 'main'
Feat/card modal/effect See merge request
mycard/Neos!185
parents
a47e1e93
46c3c9fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
5 deletions
+51
-5
src/service/duel/selectOption.ts
src/service/duel/selectOption.ts
+0
-1
src/stores/messageStore/types.ts
src/stores/messageStore/types.ts
+1
-1
src/ui/Duel/Message/CardModal.tsx
src/ui/Duel/Message/CardModal.tsx
+49
-3
src/ui/Duel/PlayMat/Mat.tsx
src/ui/Duel/PlayMat/Mat.tsx
+1
-0
No files found.
src/service/duel/selectOption.ts
View file @
a2e3a130
...
...
@@ -3,7 +3,6 @@ import MsgSelectOption = ygopro.StocGameMessage.MsgSelectOption;
import
{
messageStore
}
from
"
@/stores
"
;
export
default
async
(
selectOption
:
MsgSelectOption
)
=>
{
const
player
=
selectOption
.
player
;
const
options
=
selectOption
.
options
;
await
Promise
.
all
(
...
...
src/stores/messageStore/types.ts
View file @
a2e3a130
...
...
@@ -18,7 +18,7 @@ export interface ModalState {
cardModal
:
{
isOpen
:
boolean
;
meta
?:
CardMeta
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
interactivies
:
{
desc
:
string
;
response
:
number
;
effectCode
?:
number
}[];
counters
:
{
[
type
:
number
]:
number
};
};
// 卡牌列表弹窗
...
...
src/ui/Duel/Message/CardModal.tsx
View file @
a2e3a130
...
...
@@ -4,7 +4,7 @@ import classnames from "classnames";
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
fetchStrings
,
getCardStr
,
sendSelectIdleCmdResponse
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearAllIdleInteractivities
as
clearAllIdleInteractivities
,
...
...
@@ -40,7 +40,12 @@ export const CardModal = () => {
const
imgUrl
=
meta
?.
id
?
`
${
NeosConfig
.
cardImgUrl
}
/
${
meta
.
id
}
.jpg`
:
undefined
;
const
interactivies
=
snap
.
interactivies
;
const
nonEffectInteractivies
=
snap
.
interactivies
.
filter
(
(
item
)
=>
item
.
desc
!=
"
发动效果
"
);
const
effectInteractivies
=
snap
.
interactivies
.
filter
(
(
item
)
=>
item
.
desc
==
"
发动效果
"
);
return
(
<
div
...
...
@@ -63,7 +68,7 @@ export const CardModal = () => {
<
AtkLine
atk=
{
atk
}
def=
{
def
}
/>
<
CounterLine
counters=
{
counters
}
/>
<
div
className=
"card-modal-effect"
>
{
desc
}
</
div
>
{
i
nteractivies
.
map
((
interactive
,
idx
)
=>
{
{
nonEffectI
nteractivies
.
map
((
interactive
,
idx
)
=>
{
return
(
<
button
key=
{
idx
}
...
...
@@ -79,6 +84,47 @@ export const CardModal = () => {
</
button
>
);
})
}
{
effectInteractivies
.
length
>
0
?
(
effectInteractivies
.
length
==
1
?
(
// 如果只有一个效果,点击直接触发
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
effectInteractivies
[
0
].
response
);
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
}
}
>
{
effectInteractivies
[
0
].
desc
}
</
button
>
)
:
(
// 如果有多个效果,点击后进入`OptionModal`选择
<
button
className=
"card-modal-btn"
onClick=
{
()
=>
{
for
(
const
effect
of
effectInteractivies
)
{
const
effectMsg
=
meta
&&
effect
.
effectCode
?
getCardStr
(
meta
,
effect
.
effectCode
&
0xf
)
??
"
[:?]
"
:
"
[:?]
"
;
messageStore
.
optionModal
.
options
.
push
({
msg
:
effectMsg
,
response
:
effect
.
response
,
});
}
cardModal
.
isOpen
=
false
;
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
messageStore
.
optionModal
.
isOpen
=
true
;
}
}
>
发动效果
</
button
>
)
)
:
(
<></>
)
}
</
div
>
</
div
>
);
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
a2e3a130
...
...
@@ -247,6 +247,7 @@ const onCardClick = (state: CardState) => () => {
messageStore
.
cardModal
.
interactivies
=
state
.
idleInteractivities
.
map
(
(
interactivity
)
=>
({
desc
:
interactTypeToString
(
interactivity
.
interactType
),
effectCode
:
interactivity
.
activateIndex
,
response
:
interactivity
.
response
,
})
);
...
...
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