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
20776ae3
Commit
20776ae3
authored
May 09, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize card modal effect button
parent
a47e1e93
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-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
+31
-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 @
20776ae3
...
...
@@ -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 @
20776ae3
...
...
@@ -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 @
20776ae3
...
...
@@ -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,29 @@ export const CardModal = () => {
</
button
>
);
})
}
{
effectInteractivies
.
length
>
0
?
(
<
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
;
messageStore
.
optionModal
.
isOpen
=
true
;
}
}
>
发动效果
</
button
>
)
:
(
<></>
)
}
</
div
>
</
div
>
);
...
...
src/ui/Duel/PlayMat/Mat.tsx
View file @
20776ae3
...
...
@@ -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